Ets_Obj_Attr_Set_From_Obj_Attr()
Abstract
Sets the specified attribute of an object to the current value of another object's attribute (or possibly another attribute of the same object).
Syntax
Ets_Obj_Attr_Set_From_Obj_Attr (obj_hndl, attr_name, src_obj_hndl, src_attr_name)
| Argument | Type | Description |
|---|---|---|
obj_hndl |
EtsT_Obj_Handle |
Handle for the destination object whose attribute will be set. |
attr_name |
const char * |
The attribute name for the destination object. |
src_obj_hndl |
EtsT_Obj_Handle |
Handle for the source object that provides a value of its attribute to the destination object. |
src_attr_name |
const char * |
The attribute name of the source object. |
Return Type
EtsT_Compcode
EtsC_Compcode_Success if the operation was successful; EtsC_Compcode_Failure otherwise.
Header
ets_api_obj.h
Details
This function sets the specified attribute of an object to the current value of another object's attribute (or possibly another attribute of the same object).
The object need not be installed in a model. The attribute to be set is symbolic (otherwise, EtsC_Compcode_Failure will be returned). If the source attribute is symbolic, then this function will attempt to apply that symbol to the new attribute, but if that fails it will consider the true value of the source attribute. If the source attribute is compound, this function will recursively try to apply all of the attributes of the subobjects; however, this attempt will be done loosely and will be tolerant of any failures at the lower levels. Other conversions currently supported are:
- presentable value (int, double, bool, symbol) –> string
- int –> double
- double –> int