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.
-
On
the Custom component editor toolbar, click the Display variables
button.
The Variables dialog box opens.
-
Click
Add to create a new parametric variable.
-
In the Value type list, select Number.
-
In the Custom component browser, browse for height property of the beam.
-
Right-click Height and select Copy Reference.
-
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.
-
Click
Add to create another parametric variable.
-
In the Value type list, select Distance list for the new variable.
-
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.
-
In the Custom component browser, browse for Bolt group distance x.
-
Right-click Bolt
group distance x and select Add Equation.
-
Enter P2
after the equal sign, and then press Enter.
-
Save the custom component.
-
Close the custom component editor.
When you now change the beam height, the number of bolt rows changes as well.