Templates
Use the Templates tool to create and edit blocks of text that contain data fields and programming instructions.
Create Templates
- From the Project Browser, select the system to which the template is to be added.
-
Right-click on a system in the Project Browser and select Add > General MDL Entity > Template from the context menu.
ORRight-click on a template folder in the Project Browser and select Add Template from the context menu.ORFrom the Analyze ribbon, Simple Run tool set, click the Templates icon.The Add Template dialog is displayed.
- Specify a label for the template.
-
Specify a variable name for the template.
By default, variables names of entities in MotionView follow a certain convention. For example, all template entities have a variable name starting with “tmplt_”. This is the recommended convention to follow when building models in MotionView since it has many advantages in model editing and model manipulation.
-
Click OK to close the window or
Apply to continue creating entities.
Once a template entity has been added to the model, the panel for the template will automatically be displayed in the panel area.
Edit Templates
The Templates panel allows you to include templates in the model file when the model file is written to the solver. A system can contain any number of templates.
-
If the Templates panel is not currently displayed, select the desired template
by clicking on it in the Project Browser or in the
modeling window.
The Templates panel is automatically displayed.
- From the Properties tab, use the Type drop-down menu to select where to write the template. It can also remain internal and not be written at all.
-
Select a solver from the Insert drop-down menu then click
Insert to insert the solver mode to the text
box.
Tip:
- Click to display the Expression Builder.
- Click Edit to switch the editing window between template mode and evaluated mode. When Edit is on, the text can be edited and Templex commands are displayed. When Edit is off, the template is evaluated and the results of the evaluation are displayed in the text window.
- Click the Attachments tab.
-
Click Add.
The Add an Attachment dialog is displayed.
- Select the entity you wish to attach from the drop-down.
- Specify a label, variable name, and optional note for the entity
- Specify whether to create a single entity or an entity pair.
- Click OK to close the window or Apply to continue creating entities.
-
Click the collector associated with the created entity and make your selection
in the modeling window, or double-click the collector to
open the Model Tree (from which the desired entity can
be selected).
Tip:
- Select an entity and click Delete to remove the dataset attachment.
- Select an entity and click Edit to display the Edit an Attachment dialog, which is used to modify the dataset attachment.