Set object properties by using parametric variables

Tekla Structures
2021
Tekla Structures

Set object properties by using parametric variables

Use parametric variables to set basic properties (such as name, material, profile, position number, and so on) for any object the custom component creates. Parametric variables automatically get the prefix P (parameter), which is shown in the Variables dialog box.

The following example shows how to create a variable that sets all welds in a custom component to a given size. After creating the variable, you are able to change the weld size directly in the custom component's dialog box.

  1. In the custom component editor, click the Display variables button .

    The Variables dialog box opens.

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

    You can also use the default name, such as P1. In this example, enter Weldsize as the name of the variable.

  4. In the Value type list, select a suitable value type.

    The type determines what kind of values can be used with this variable. In this example, select Length, which is suitable for lengths and distances.

  5. In the Formula box, enter a value or variable formula.

    Leave this box empty.

  6. In the Label in dialog box box, enter a descriptive name for the parametric variable.

    This label will be shown in the custom component's dialog box. In this example, enter Weld size as the label.

  7. In the Visibility list, define whether the variable will be visible in the custom component's dialog box.

    Hide the variable if you only use it in calculations. Show the variable if you want to be able to edit the value in the custom component's dialog box. In this example, select Show.

  8. Click Close.

    You have now created a parametric variable with the following settings:

  9. In the Custom component browser, link the variable to the desired object property.
    1. Select the property.

      Select the Size above line property of the uppermost weld.

    2. Right-click the property and select Add Equation.

    3. After the equal sign, enter the name of the parametric variable.

      Enter Weldsize here.

      You can now modify the Size above line property by using the Weld size box in the custom component's dialog box.

  10. Repeat step 9 for any other property of the same type, if needed.

    Repeat the procedure for the other welds as well, so that they will all be linked to the Weld size box in the custom component's dialog box.

  11. Save the custom component.

    The variable is now displayed in the custom component's dialog box, unless you set the visibility of the variable to Hide in step 7.

    If you change the weld size value now, the size of all welds within the custom component will change accordingly.

Was this helpful?
Föregående
Nästa