op_ima_obj_attr_get_color()
Abstract
Obtains the value of a color attribute in the specified object.
Syntax
op_ima_obj_attr_get_color (objid, attr_name, color_ptr)
| Argument | Type | Description |
|---|---|---|
objid |
Objid |
object ID of the object-of-interest [An object ID can be obtained from several KPs in the Topo and Id packages: op_id_self(), op_topo_parent(), op_topo_child(), op_id_from_userid(), and op_id_from_name().] |
attr_name |
const char * |
name of the attribute-of-interest [This attribute must be of type color and defined in the specified object, or an error will occur.] |
color_ptr |
PrgT_Color * |
pointer to a variable to be filled with the specified attribute’s value |
Return Type
Compcode
OPC_COMPCODE_SUCCESS if the attribute value was successfully obtained; OPC_COMPCODE_FAILURE otherwise.
Example
PrgT_Color color;
/* get the link color */
op_ima_obj_attr_get_color (link_objid, "color", &color);
Details
None.
Purpose
Provides a mechanism to dynamically obtain object attributes during the course of the simulation. This KP works identically to op_ima_obj_attr_get(), but applies only to object attributes of data type PrgT_Color. Refer to op_ima_obj_attr_get() for full purpose and details.
Errors
- Same as op_ima_obj_attr_get(), plus the following:
- Program Abort: Attribute (
<attr_name>) is of type (<type>). Can’t get its value as type (color).
Reference
- Use the KPs op_ima_obj_attr_set_color() or op_ima_obj_attr_set() to assign a value to an object color attribute
- Use the KPs op_ima_sim_attr_get_color() or op_ima_sim_attr_get() to obtain the value of a simulation color attribute
- Use the KP op_id_self() to obtain the object ID of the surrounding processor or queue
- Use the KP op_id_from_name() to obtain the object ID of an arbitrary object