Skip to main content

Control functions in Template Editor

Tekla Structures 2022
2022
Tekla Structures

Use control functions within a conditional structure to inquire or define the output of a row and / or rows in the hierarchy. They have no parameters.

To understand how control functions work, you must be familiar with the template output process.

Access control functions in the Rule Contents dialog box. Select functions from the Control list.

Some control functions can be used in formulas as well (IsFirst, IsLast, PageBreak). Access control functions in the Formula Contents dialog box from the Control list.

IsFirst

This function checks if the row is the first one, and returns TRUE if it is. This function can be used in both row rules and value field formulas.

This rule outputs the first row only and skips the rest. For each row, it checks, if the row is the first one. If it is, the row is output, otherwise the row is stepped over.

IsLast

This function checks if the row is the last one and returns TRUE if it is. This function can be used in both row rules and value field formulas.

This rule outputs the last row only and skips the rest. For each row, it checks, if the row is the last one. If it is, the row is output, otherwise the row is stepped over.

Output

This function outputs the current row. Use this function when you want to output the row that fulfills the condition you specify. The condition can evaluate, for example, the position of the row or the field values on the row.

This rule outputs rows if the LENGTH attribute is greater than 50. If the LENGTH attribute is less than or equal to 50, those rows are skipped.

You can also override the color of template objects with the Output function with the following syntax:

Output("#<key>=<color>;")

The following abbreviations are keys that refer to the template objects in question:

  • VFC (value field color)

  • TXC (text color)

  • DRC (drawing object color)

You can combine these values in one row rule using a semicolon as a separator. This rule overrides the colors when the LENGTH attribute is longer than 1000, then value fields are orange, text objects are yellow and the drawing color is blue (i.e. lines are blue).

PageBreak

This function inserts a page break. This function can be used in both row rules and value field formulas.

The following rule inserts a page break when the condition is true.

StepIn

Use this function when you want to process the rows that are located below the current row in the hierarchy.

The following rule checks the value of a value field on the row. If the value is "B", the row is output, otherwise the rows below in hierarchy are processed. If there are no rows below, the processing continues with the next row on the same level.

StepOut

Use this function to stop processing the current row and rows below it in the hierarchy, and continue to processing the row higher in the hierarchy. If no row higher in the hierarchy exists or if this was the last row in the template, then the function starts processing again from the first row of the template.

The following rule checks if the row is the first one. If this is true, the row is output, otherwise the processing continues to the row higher in the hierarchy.

StepOver

Use this function when you want to ignore the current row and continue to the next row.

The rule outputs values less than or equal to 30. If those values are not found, they are skipped.

Submit

Table of Contents