EMA Built-In Attributes
To facilitate the general manipulation of models and objects, several attributes have been built into the Ema package that can be accessed for generic models or objects, regardless of type. There are currently four such built-in attributes, and they are all get-only, since they are queries about model or object data. Each is described below.
ATTR_EMA_TYPE
This attribute is supported for both models and objects. It provides a means of determining the type of a model or object when this data is unknown. For instance, if an object ID is passed to a function that will perform different actions depending on the object type, the object type can be obtained using this attribute. The only component supported by this attribute is COMP_CONTENTS.
ATTR_EMA_INDEX
This attribute is only supported for objects. It provides a means of determining the index of an object in the set of all objects of the same type within a model. For instance, if object “E” is the third object of its type to be created, then this attribute will take on the value 2 (object indices start at zero). The only component supported by this attribute is COMP_CONTENTS.
ATTR_EMA_NUM_ATTRS
This attribute is supported for both models and objects. It provides a means of determining the number of attributes contained within a specified model or object. This quantity can be useful in procedures that will loop through all attributes of a model or object and perform some operation on each one (such as printing their contents). The only component supported by this attribute is COMP_CONTENTS.
ATTR_EMA_NUM_OBJECTS
This attribute is supported for models. It provides a means of determining the number of objects of a particular type that are contained in a model. This quantity is useful when looping through all the objects in a model with a particular type. This attribute is used in conjunction with the COMP_OBTYPE component.