Edit a Template Module
Edit a Template Module
To edit a Template Module, go to the Advanced Settings overview page and select Edit Template Modules from the left menu.
The Manage Template Modules page is displayed:
Hover over a Template Module to display the Context menu:
Click on the Context menu for a Template Module and select Edit:
The Edit Template side panel window is opened:
You can edit the following information:
- Template Type: Update the Template Type.
- You can choose to:
-
Add code before the template
-
Replace the template (default)
-
Add code after the related template
-
- You can choose to:
- Model Object Type: Template Model Object Type
- Update the Model Object Type for which the Template will be applied:
- Update the Model Object Type for which the Template will be applied:
- Part per Model Object Type: Depending on the selected Model Object Type, the list of its parts is displayed.
- Select the Part for which the Template will be applied as follows, with Link selected as Model Object Type:
- Select the Part for which the Template will be applied as follows, with Link selected as Model Object Type:
- Use for all future Model Objects: if you check the box, the Template will be automatically applied for all future Model Objects of the Type defined in Step 2
- Model Objects list: the list of Model Objects for the selected Model Object Type is displayed
- Select the Model Objects to which the Template will be applied, as shown in the example (with Link selected as the Model Object Type)
- A search box allows you to filter the list of Model Objects.
- Select the Model Objects to which the Template will be applied, as shown in the example (with Link selected as the Model Object Type)
- Editor: The Template code should be written in C# within the method WriteOutput(TargetObject targetObject, ITemplateContext templateContext)
- An IntelliSense editor (based on the Generator methods and classes) is available, for example:
- Some code snippets are available by typing bigenius:
- Select a snippet, such as
"iterator through terms"
, and the corresponding code will be inserted.
- Select a snippet, such as
- An IntelliSense editor (based on the Generator methods and classes) is available, for example:
- Click the API Documentation link to open the documentation and access guidance for developing a custom template.
- Click the Validate button to compile the Template code. Any compilation errors or warnings will be displayed below the code.
- By selecting the PREVIEW tab, you can preview the generation result of the Template Module
- By selecting the ARCHITECTURE MODEL VIEW tab, you can display the Architecture Model for a Model Object in a Template Module
Demonstration video