The 3D ACIS® Modeler (ACIS) is Spatial’s prominent 3D solid modeling engine. 3D InterOp is a CAD data translation framework (Interoperability)
Component:Generic Attributes
From DocR20
The Generic Attributes Component (GA) provides a means for applications to exchange data. The GA classes allow items such as names, numbers, strings, vectors, and positions to be attached to an entity or a list of entities as an attribute. GA created attributes can be saved and restored.
Generic attributes allow applications to exchange data that is not supported by ACIS without having to share code to define new ENTITY and/or ATTRIB classes. Each generic attribute associates a name with a simple data value. Attributes are defined which have integer, real, string, position, vector, and entity values. There is also an attribute with only a name and no associated value. Hierarchies of values can be created by attaching attributes to other attributes to represent more complex data structures.
| Class | Description |
|---|---|
| ATTRIB_GEN_NAME | Stores a name. |
| ATTRIB_GEN_INTEGER | Stores a named integral value. |
| ATTRIB_GEN_REAL | Stores a named floating-point double value. |
| ATTRIB_GEN_POINTER | Stores a named pointer to an ENTITY. ("Weak" relationship.) |
| ATTRIB_GEN_ENTITY | Stores a named pointer to an ENTITY. ("Strong" relationship.) |
| ATTRIB_GEN_POSITION | Stores a named 3-space position (three doubles). |
| ATTRIB_GEN_VECTOR | Stores a named 3-space vector (three doubles). |
| ATTRIB_GEN_STRING | Stores a named single-byte character string (char). |
| ATTRIB_GEN_WSTRING | Stores a named wide character string (wchar_t). |
APIs
Generic Attributes can be constructed directly onto an ENTITY using ACIS_NEW. Alternately, we provide several overload flavors for api_add_generic_named_attribute, for example, api_add_generic_named_attribute.
To remove a Generic Attribute from an ENTITY, we suggest using api_remove_generic_named_attribute.
Functions
| Operation | Description |
|---|---|
| find_named_attrib | Returns a pointer to the first generic attribute with the given name in an ENTITY's list of attributes. |
| find_next_named_attrib | Returns a pointer to the next generic attribute with the same name and owner as the supplied attribute. |
When creating a Generic Attribute, you can specify how the attribute should behave when its owner is split, merged, transformed, or copied. For example, if your Generic Attribute is attached to a FACE and the FACE is split during a modeling operation, you can specify that your Generic Attribute copy itself to the new FACE created by the split. Plus, if you use one of our predefined behaviors, it is saved along with your Generic Attribute. This ensures that your Generic Attribute will behave as you desire, even outside your application.
For customized behavior within your application, Generic Attributes can also be instructed to call an application specified function when split, merged, transformed, or copied.
The following enums are used for specifying how your attribute should behave when split, merged, transformed, and copied: split_action, merge_action, trans_action, and copy_action.
If the predefined Generic Attribute behaviors and/or capabilities do not meet your application's needs, consider creating your own custom attribute. Refer to these articles for more information: Attributes and Attribute Tutorial.
