Example of a variable formula: Calculate the number of bolt rows

Tekla Structures
2021
Tekla Structures

Example of a variable formula: Calculate the number of bolt rows

This example shows how to create a variable formula that calculates the number of bolt rows based on the beam height. You will use if statements in the calculations.

  1. On the Custom component editor toolbar, click the Display variables button.

    The Variables dialog box opens.

  2. Click Add to create a new parametric variable.
  3. In the Value type list, select Number.
  4. In the Custom component browser, browse for height property of the beam.
  5. Right-click Height and select Copy Reference.
  6. In the Formula box, enter the following if statement for the parametric variable:
    =if (fP(Height,"ID50B8559A-0000-00FD-3133-353432363133")< 301) then 2 else (if (fP(Height,"ID50B8559A-0000-00FD-3133-353432363133")>501) then 4 else 3 endif) endif

    In the formula, fP(Height,"ID50B8559A-0000-00FD-3133-353432363133") is the beam height reference copied from the Custom component browser. The variable gets its value in the following way:

    • If the beam height is under 301 mm, the value is 2.
    • If the beam height is over 501 mm, the value is 4.
    • If the beam height is between 300 and 500 mm, the value is 3.
  7. Click Add to create another parametric variable.
  8. In the Value type list, select Distance list for the new variable.
  9. In the Formula box, enter =P1+"*"+100 for the new variable.

    In the formula, 100 is the bolt spacing and the P1 value is the number of bolt rows.

  10. In the Custom component browser, browse for Bolt group distance x.
  11. Right-click Bolt group distance x and select Add Equation.
  12. Enter P2 after the equal sign, and then press Enter.
  13. Save the custom component.
  14. Close the custom component editor.

When you now change the beam height, the number of bolt rows changes as well.

Was this helpful?
Previous
Next