Use the Templates tool to create and edit blocks of text that contain data fields and programming instructions.

Create Templates

  1. From the Project Browser, select the system to which the template is to be added.
  2. Right-click on a system in the Project Browser and select Add > General MDL Entity > Template from the context menu.
    Right-click on a template folder in the Project Browser and select Add Template from the context menu.
    Right-click the Template button on the General MDL toolbar.
    The Add Template dialog is displayed.
  3. Specify a label for the template.
  4. 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.
  5. 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.

  1. 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.
  2. 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.
  3. Select a solver from the Insert drop-down menu then click Insert to insert the solver mode to the text box.
    • 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.
  4. Click the Attachments tab.
  5. Click Add.
    The Add an Attachment dialog is displayed.
  6. Select the entity you wish to attach from the drop-down.
  7. Specify a label, variable name, and optional note for the entity
  8. Specify whether to create a single entity or an entity pair.
  9. Click OK to close the window or Apply to continue creating entities.
  10. 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).
    • 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.