-
From the template editor, select the OTScript
tab.
-
To define some OTScript code in the coding area, you can do any of:
- Enter or copy OTScript code corresponding to one or more methods.
Note:
To find the
internal name of a method, hover over its name in the Data
tab or
hover over the loop that calls it.
- Drop a method from the Data
tab into
the coding area.
-
Define the custom methods getConnectedIds and
getConnectedComponents based on the “Change action” method to
return all child components of a physical component.
-
To compile and save the code, click Save
.
Note:
If OTScript finds an error, it marks the line. Hover over the mark to
see the error message. OTScript shows only the first error.Correct errors one by one
to be able to generate reports.
Result:
Methods defined in the OTScript code appear in the Data
tab of the
template editor. If no category is indicated in the code, methods are presented in the
Extensions category.
You can insert these methods, as usual, in your current template.