Example of a variable formula: Calculate the number of handrail posts using a template attribute

Tekla Structures
2021
Tekla Structures

Example of a variable formula: Calculate the number of handrail posts using a template attribute

This example shows how to create a variable formula that calculates the number of handrail posts based on the length template attribute of the beam. The handrail posts were created at both ends of the beam and one of them was copied with the Array of objects (29) component.

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

    The Variables dialog box opens.

  2. Create three new parametric variables by clicking Add.
  3. Modify the variable P1 as follows:
    • In the Formula box, enter 250.
    • In the Label in dialog box box, enter End Distance.
  4. Modify the variable P2 as follows:
    • In the Formula box, enter 900.
    • In the Label in dialog box box, enter Spacing.
  5. Modify the variable P3 as follows:
    • In the Value type box, select Number.
    • In the Label in dialog box box, enter Number of Posts.
  6. Inquire the GUID of the beam:
    1. On the ribbon, click Inquire objects .
    2. Select the beam.
    3. Check the GUID of the beam in the Inquire Object dialog box.
  7. In the Formula box of the P3 variable, enter =(fTpl("LENGTH","ID50B8559A-0000-010B-3133-353432373038")-(P1*2))/P2.

    fTpl("LENGTH","ID50B8559A-0000-010B-3133-353432373038") is the length template attribute of the beam and ID50B8559A-0000-010B-3133-353432373038 is the GUID of the beam.

    The number of the posts is calculated as follows: First the end distances are subtracted from the beam length, and then the result is divided by the post spacing.

  8. In the Custom component editor, link the variables P2 and P3 to the properties of Array of objects (29).
    1. Right-click dist_between_elem and select Add Equation.
    2. Enter P2 after the equal sign, and then press Enter.
    3. Right-click number_of_arrays and select Add Equation.
    4. Enter P3 after the equal sign, and then press Enter.

  9. Bind the first post to the beam end.
    1. Select the post in the custom component view.
    2. Hold down Alt and use area selection (from left to right) to select the post handles.
    3. Right-click and select Bind to plane.

  10. Bind the last post to the other beam end by following the instructions in step 9.
  11. Modify the distance variables as follows:
    1. In the Formula box, enter =P1.
    2. In the Visibility list, select Hide.

  12. Save the custom component.
  13. Close the custom component editor.

You can now change the spacing and the end distance of the handrail posts in the custom component dialog box. Tekla Structures calculates the number of posts based on the spacing, end distance, and length of the beam.

Bylo to užitečné?
Předchozí
Další