Skip to main content

Create a variable formula

Modified: 31 Oct 2025 Tekla Structures 2026
2026
Tekla Structures

Use variable formulas to add more adaptivity to your custom components.

Variable formulas always begin with the equal sign (=).

At its simplest, a formula can be a simple dependency between two variables, stating that P2 equals half of P1 (P2=P1/2), for example.

To create more complex calculations, you can use functions and operators inside the formula. For example, you can add mathematical expressions, if statements, references to object properties, and so on.

When you create formulas, note that multiplication is faster than division, for example, P1*0.5 is faster than P1/2.

Example: Create a variable formula to set the weld size based on flange thickness

The following example shows how to create a formula that sets the weld size to half the thickness of the secondary part flange. When the component is used in a model, Tekla Structures will use the thickness of the secondary part flange to calculate the size of the weld.

  1. Select the custom component in the model, right-click and select Edit custom component.
  2. On the Custom component editor toolbar, click the Display variables button.

    The Variables dialog opens.

  3. Create a new parametric variable.
    1. Click Add.
    2. In the Name box, enter a name for the variable.

      In this example, enter w as the name of the variable.

  4. Copy the flange thickness reference in the Custom component browser.
    1. Browse for Flange thickness 1 property in Input objects > Secondary parts > Part > Profile properties.
    2. Right-click Flange thickness 1 and select Copy reference.

      Tekla Structures copies the reference to flange thickness to the clipboard.

  5. To set the formula in the Variables dialog, modify the parametric variable as follows:
    1. In the Formula box, type =, right-click, and select Paste.

      Tekla Structures pastes the reference to flange thickness from the clipboard.

    2. After the flange thickness formula, enter *0.5.

      The formula should now read:

      =fP(Flange thickness 1,"<GUID>")*0.5

    3. In the Value type list, select Length.
    4. In the Visibility list, select Hide.

  6. Link the parametric variable to the Size above line property.
    1. In the Custom component browser, browse for Size above line in Component objects > Weld > General properties.
    2. Right-click Size above line and select Add equation.
    3. Enter w after the equal sign, and then press Enter.

  7. Save the custom component.
  8. Close the custom component editor.
  9. Select the custom component in the model, and open the custom component dialog.

    You can now use the thickness of the secondary part flange to calculate the size of the weld.

Submit

Table of Contents