Templates

You can create templates from nodes, systems, or selections. All templates are stored as .otpl files.

All available templates are shown in a file tree in the Templates pane. You can create new folders and sub-folders by right-clicking a folder (including the top level Templates folder) in the file tree and selecting New folder in the context menu. You can also move the templates around in the file tree by dragging and dropping them into a different folder.


Important:  Templates do not support storing or restoring file registration and placeholder configurations.


To create a new template:

  1. Right-click the system, node, or selected components and select Create > Create template from component from the context menu.

  2. In the Select Template Path dialog box, click the folder where you want to store the template.

  3. Click OK.

To change the default name of the template, in the Templates pane, double-click the name and enter a new one.

Restrictions for template names:

  • Restricted characters: \ / : * ? " < > |

  • Restricted names: NUL PRN AUX CON COM1...COM9 LPT1...LPT9

To use a template, drag it from the Templates pane and drop it onto the Scenery pane.

You can also perform the following actions directly from a file browser such as Windows Explorer:

  • Open a template directly by double-clicking it. It is added to the Scenery pane of a new project in optiSLang.

  • Copy a template to another location.

  • Import a template by dragging and dropping it from the file browser to the Templates pane in optiSLang.

  • Export a template by dragging and dropping it from the Templates pane in optiSLang to the file browser.

  • Drag a template from the file browser and drop it onto the Scenery pane.

Template paths on the local computer or in the network can be specified by:

  • Right-clicking the Templates pane and selecting Register new template source from the context menu.

  • Setting the path in the environment variable OSL_TEMPLATE_DIRS, separated by the appropriate environment separator (; on Windows platforms, : on Linux platforms)

Platform dependent standard template paths are:

  • Linux: /home/USER_NAME/.local/share/data/Ansys/optiSLang/Templates * or: $HOME/.local/share/data/Ansys/optiSLang/Templates

  • Windows: %LOCALAPPDATA%\Ansys\optiSLang\Templates