Customizing the metamodel > Metamodel graphical editor > Advanced use of user-defined definitions
  
Advanced use of user-defined definitions
If you have advanced knowledge of the System Architect scripting language, you can extend the definition types that are created by adding “text blocks” in the wanted section of the USRPROPS.TXT file. To do this, create a User Object Fragment definition. This allows you to create command fragments such as #IFDEF and #ENDIF statements.
Here is an example of using #idef and #endif to add text blocks in a section of the USRPROPS.TXT file:
#ifdef "UML Object-oriented"
SYMBOL "Component2"
{
Assign To "Component"
PROPERTY "Stereotype" { INVISIBLE EDIT Text ListOnly
List "Component Stereotypes" DEFAULT "" LENGTH 32}
}
#endif
If you want to add these entries then you must create User Object Fragments, User Symbol Types, User Symbol Properties, User List, and a User Props File definitions.
1 Create a User Object Fragment called PreSymbolFragment.
2 In the Text field, add:
#ifdef "UML Object-Oriented"
This graphic is described in the surrounding text.
3 Create a User Object Fragment called PostSymbolFragment.
4 In the Text field, add:
#end if
This graphic is described in the surrounding text.
5 Create a User Symbol Type called Component 2.
6 In Assign To Diagram, type Component, and then click Yes for the Advanced Properties.
This graphic is described in the surrounding text.
7 Create a User Symbol Property called Stereotype.
8 Add Component2 as the User Symbol Type property.
9 In the Properties tab of the User Symbol Type Component 2, click Choices, and then add the User Symbol Property called Stereotype.
This graphic is described in the surrounding text.
10 Create a User List called Component Stereotypes.
This graphic is described in the surrounding text.
11 Open the User Symbol Type definition called Component 2.
12 On the Advanced tab, perform these actions:
Add PreSymbolFragment in the Text Fragment before Symbol section.
Add PostSymbolFragrament in the Text Fragment after Symbol section.
This graphic is described in the surrounding text.
13 Create a User Props Definition, and then add the User List and User Symbol Type definition to Select Objects in the sequence to be generated.
14 Now generate the User Props txt file to include the above changes, and add them into a production encyclopedia.
You can also include references to other files in the USRPROPS.TXT, by using the #include command. Type the actual file fragment in the User File Fragment’s Text property, and then add it in the proper place in the User Props File definition.
See also
Metamodel graphical editor