6.11.  Extending the Type Model

For every project a Type Model can be created extending the global Type Model. This model belongs to the project and can be shared like any other pure::variants model. This is an easy and a straight forward way to contribute own types to be used in the Feature and Family Models of the project containing the Type Model.

To create a Type Model right-click on a project in the Variant Project View and choose New->Type Model from the context menu. This creates a new file in the project named like the project and with extension ".typemodel". Note that only one Type Model can be created per project. The new Type Model is opened in the Type Model Editor. This editor also is opened by double-clicking on an existing Type Model file (see Figure 6.45, “Type Model Editor Example” ).

The Type Model Editor consists of two parts. The left part shows the list of types defined in the model, while the right part provides an editing area for the type selected on the left. Additionally the left part provides a context menu for adding and removing types of the type model.

The Type Model Editor allows to add element and attribute types. After adding an attribute type the right part allows to change the Name , Base Type (that is the type which this type is specializing), whether this type is Abstract (and thus can only be used as base type for other types), and whether this is an enumeration type only allowing one of the listed values.

The editor provides for element types to change the Label , Name and the Base Type . Additionally the element type may be set Abstract and if there shall be a generic New Wizard, which would allow to easily create an element of that type. Since 5.0.9 a custom icon can for element types can be defined. The editor allows to set and delete custom icons for element types.

For an element type attributes can be created. Those attributes present the default attributes which are defined for a concrete element of that type. For each attribute a Name , a Type , whether it is a Single Value , List or Set can be specified. Following flags can be set for an attribute: Optional (whether this attribute is required for an element), Fixed (whether it has a constant value or can be overridden in a VDM), Read Only (whether the user can provide a value for it) and Invisible (whether it is visible to the user).

After a Type Model was created or changed, the types defined in the Type Model are immediately available for modeling in the corresponding project.

Figure 6.45. Type Model Editor Example

Type Model Editor Example