Classes and properties

In several applications, it may be necessary to associate alphanumeric information to the model/drawing or parts of the drawing/model (solids, simple entities). For this purpose, the application has non-graphic entities (strings, integers or real numbers) which can be associated to the model/drawing or to component entities: these are the properties (UDP=User Defined Property).

This section describes:


Property classes

The property class identifies the set of characteristics of the properties to be assigned. A property class is defined by:

The definition of a property class makes it possible to assign properties belonging to the class defined, whose content matches the type specified.


Names of the property classes

The names of the property classes are subject to the following conventions:

The letters contained in the name are converted by the program to uppercase. Therefore, in all the application output (lists and global variables), the name of a property class or a property is in uppercase.


Empty classes

When there is no property associated to an entity or the modeldrawing for a defined property class, the class is said to be empty. Deletion and some types of modification of a class may only be performed if the class is empty; for example, changing the type of a class when properties are already assigned could cause problems.


Functioning

Association of properties to the modeldrawing or parts of the modeldrawing requires the following:

  1. define the corresponding property class.
  2. assign the properties by associating them to the modeldrawing or to one or more parts of the modeldrawing and assigning values.

For example, to assign the codes to the parts of a modeldrawing, a "code" class with the appropriate characteristics must be defined (which, in the majority of cases, may be an alphanumeric - string -, which can only be assigned to solids).

The operations for the property and the class require the following commands:

Create UDC Defines a new property class
Modify UDC Modifies a property class
Delete UDC Deletes a property class
Assign UDP Assigns a property to an entity or to the modeldrawing
Modify UDP Modifies the value of a property already assigned to an entity.
Delete UDP Deletes the assigning of a property to an entity

In addition to the above commands, to control UDCs and UDPs of the model/drawing itself, see also:


Note

Copies of objects do NOT maintain the properties assigned to the original. Furthermore, if features are added to a solid, the previously assigned properties are deleted.


Importing modelsdrawings and properties

If another modeldrawing contained in a file is imported to the current modeldrawing, the non-empty classes and the relative properties are also imported. The application manages problems of incompatibility between classes with the same name in the current modeldrawing and the modeldrawing you want to import.

Two classes are considered to be incompatible if:

In the event of incompatibility, the program automatically modifies the name of the class to be imported, adding a suffix consisting of the "_" character and a sequence number (from 1 to 100).

For example, a Character CODE class is defined in the current modeldrawing. An Integer CODE class is defined in the modeldrawing you want to import. It will be imported with the name CODE_1.

If the properties of the imported modeldrawing have the same name as those in the current modeldrawing but they are not incompatible, the properties imported may be referred to classes which are slightly different from the original ones, in terms of assignability and protections. The values assigned, however, will be maintained.

For example, the C CODE is defined in the current modeldrawing, assignable to all but not to the modeldrawing as a whole. A C CODE is also defined in the modeldrawing to be imported, also assignable to all. After the import, all the CODE properties assigned to any entities of the imported modeldrawing are maintained while any properties assigned to the imported modeldrawing as a whole are lost.


How to display the properties

A set of symbolic notations (see "Symbolic text") can be used within text and dimensions to display the property values.

For example, to display the value of a property assigned to an entity in a label, use the symbolic text $QS{property_name}. If a CODE property is defined, you can add the text $QS{CODE} in the label to display the CODE value:



You can try to obtain the example above by opening the file called cl_01_06.e3 and adding the label $QS{CODE}.

Similarly, you can use the symbolic text $M{property_name} to display the value of a property assigned to the model/drawing.