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.
the custom component editor, click the Display variables
The Variables dialog box opens.
- Click Add to create a new parametric variable.
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.
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.
In the Formula box, enter a value or variable formula.
Leave this box empty.
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.
In the Visibility list, define whether the variable will be visible in the custom component's
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.
You have now created a parametric variable with the following settings:
the Custom component browser, link the variable to the desired object property.
Select the property.
Select the Size above line property of the uppermost weld.
Right-click the property and select Add Equation.
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.
- Select the property.
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.
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.