Variables are the properties of a custom component. Some of them appear in the custom component dialog box, others are hidden and are only used in calculations.
There are two types of variable:
Copies just the value the object currently has
Copies the link to the property. Link is dynamic, so when the property later changes the reference reflects the change
Viewing variables To see all distance and parameter variables in a component, in the custom component editor, click the Display variables icon
The Variables dialog box appears:
•
The Component parameters category lists all distances and parameters that belong to the current custom component.•
The Model parameters category lists all distances and parameters in the current model.When you select a distance variable from a list, Tekla Structures highlights it in the model.
To delete the selected distance or parameter, click Delete. To add a new parameter variable, click Add.
For more information to other properties, see Display variables (p. 115).
Topics Creating distance variables (p. 75)
Variable type Description See also Distance Distance between two planes or
between a point and a plane.
Binds parts together or works as a variable reference distance.
Creating distance variables (p. 75) Creating reference distances (p. 77) Parameter All other properties, including
name, material grade, bolt size, etc. Also used in calculations.
Creating parameter variables (p. 80) Creating parameters that use formulae (p.
81)
Using magnetic construction planes (p. 79) Creating parameter variables (p. 80)
Creating parameters that use formulae (p. 81)
Creating distance variables
Use distance variables to bind handles, fittings, cuts, and so on, to planes so that the custom component can adapt to different situations, such as different main profile shapes and sizes.
You can create a distance variable from point to plane or from plane to plane. These distances can be visible or hidden. Use visible distances when you want the user to enter a distance value in the custom component dialog box. To simply bind objects to planes, use hidden distances.
You can bind the corners of polygon plates also in directions other than the plane of the plate.
You can, for example, bind the corner of a contour plate in the z direction.
How In this example we will create a distance variable that binds the upper edge of the end plate to the upper flange of the secondary part. Whenever you create this custom component in the model, the end plate will follow the upper flange, regardless of the profile or size the secondary part.
Before you start, ensure that the part representation is set to rendered. Part surfaces and available planes can be selected only in rendered views.
To create the distance variable:
1. Select the object from which to measure the distance. This object will follow the plane to which you bind it. In this example, select the plate’s topmost reference point (magenta or yellow)
2. Click the Create distance icon or right-click the reference point and select Bind to Plane from the pop-up menu.
3. Move the mouse cursor over a view to see the available planes.
Use the automatic distances command to automatically create distances for the handles of picked components:
For more information, see Automatic distances (p. 125).
4. To create the distance, click when the plane you want to use is highlighted. Tekla Structures draws a distance symbol in the views of the custom component editor. Tekla Structures displays a distance symbol in the custom component editor views. You can bind one object to a maximum of three planes.
5. To end the command, right-click and select Interrupt.
6. Double-click the distance object. The Distance properties dialog box appears.
7. Enter a descriptive Name for the distance.
Highlighted boundary plane
You can change plane types before selecting the plane
You can also use the Hide Part command if the plane is not accessible.
Distance object
To test the distance variable, enter different values and click Modify to see the changes in the model.
9. To hide or show the distance variable in the dialog box and to set the other properties, click to open the Variables dialog box. For more information, see Display variables (p.
115).
Limitations You cannot pick points in secondary or main parts.
You cannot change an existing distance binding. You must delete the distance and then rebind it.
See also Create distance (p. 123)
Creating reference distances
Use reference distances to measure the distance between two points or a point and a plane. You can then use the reference distance in calculations, for example, to determine the spacing of rungs on a ladder.
A reference distance changes as you move the objects it refers to. Tekla Structures displays reference distances in orange.
You cannot move objects by changing their reference distances.
To be able to select distances, make sure the Select distances switch is active.
To be able to select reference distances, make sure the Select distances switch is active.
Example In this example we will define several variables: distances, reference distances, and parameters, and use them in a custom component that creates a ladder with rungs spaced at set intervals, for any length of ladder. Here is how the variables appear in the Variables dialog box:
1. Create a ladder frame with one rung 285 mm from the bottom of the frame.
2. To make the ladder a custom component, select Detailing > Define custom component...
and follow the steps in the Custom component wizard.
3. Right-click the ladder and select Edit custom component... from the popup menu.
4. In the Custom component editor, use the Array of objects (29) component to create the rest of the rungs.
Use the Create distance tool to bind the bottom rung to the bottom of the ladder frame (D1 and D2 in the in the Variables dialog box).
See Create distance (p. 123) for step-by-step instructions.
5. Use the Create reference distance tool to create a reference distance from a handle on the bottom rung to the plane at the top of the ladder.
•
Select a rung handle•
On the Custom component editor toolbar, click the Create reference distance icon•
Bind the handle to the horizontal plane at the top of the ladder frame.This distance appears as D3 in the Variables dialog box.
6. Go to the Variables dialog box.
7. Add a parameter (P1) to define rung spacing. Give it the value 250.
8. Add another parameter (P2) to define the distance from the bottom of the ladder to the first rung. Give it the value 285.
9. Give the distances D1 and D2 the formula =P2. This forces both distances to be the value defined by P2. 285 in this case.
10. Add a new parameter (P3) to define the number of rungs. Give it the formula =(D3-P2)/P1.
11. We want the number of rungs to be an integer, so add a new parameter (P4) and give it the
12. Add a new parameter (P5) to calculate the distance between the rungs. Give it the formula
=(D3-P2)/P4.
This formula subtracts the distance from the bottom of the ladder to the bottom rung from the reference distance (D3) and divides the result by the number of rungs (P4).
13. Go to the Custom component browser and link the following properties of the Array of objects (29) component to parameters P4 and P5, as shown below:
When you use this custom component to create a ladder in a model, Tekla Structures automatically calculates the correct spacing for the rungs.
See also Create reference distance (p. 124) Defining custom components (p. 62)
Using magnetic construction planes
You can bind several objects at one time using magnetic construction planes. The objects directly on a magnetic plane will move with the plane. So you only need to create a distance variable for the plane and not for each object separately.
As you can see from the example below, it is much easier and faster to use magnetic user planes than to bind handles with individual distance variables.
Example Different methods of binding chamfers to the inner face of a flange:
For more information on magnetic construction planes, see Construction plane (p. 121).
Creating parameter variables
You can use parameter variables to set basic properties for objects that custom component creates, for example, name, material, profile, position number, etc.
Example In this example we create a parameter variable "Weldsize" that sets all welds in a custom component to a given size:
1. On the Custom component editor toolbar, click to open the Variables dialog box.
2. Click the Add button.
3. Enter following information:
•
Name = Weldsize•
Formula =•
Value = 0.0•
Variable type = parameter•
Value type = length•
Visibility = Show (this makes Weldsize visible in the dialog box)•
Label in dialog box = WeldSize 4. Click OK button to close the dialog box.5. In the Custom component browser, click Component objects > Weld > General
properties and right-click Size above line and select Add equation. Type after the equal sign "Weldsize". Repeat this step for all welds.
Option 1: Control the stiffeners by using 4 magnetic construction planes - one in each direction. Then you only bind each magnetic plane with one distance variable
Option 2: Bind each chamfer separately - a total of 32 bindings
By default, the handles of contour plates are not visible. To show them, set the advanced option XS_DRAW_CHAMFERS_HANDLES to HANDLES.
6. Click Save.
7. Click Close icon to exit the Custom component editor.
Your custom component dialog box should now contain the field WeldSize. When anyone creates the component, all welds are of the size you enter in the WeldSize field.
Creating parameters that use formulae
This example shows how to create a hidden parameter variable that includes a formula to set weld size to half the thickness of the secondary part flange. This variable will not be visible in the custom component dialog box. When you create the component, Tekla Structures uses the thickness of the secondary part flange to calculate the size of the weld(s).
1. In the Custom component browser, click Input objects > Secondary parts > Part >
Profile properties and right-click Flange thickness 1 and then select Copy reference. Tekla Structures copies the reference to secondary part flange thickness to the Windows Clipboard.
2. In the Custom component editor toolbar, click to open the Variables dialog box.
3. Click Add button.
4. Set Variable name to w.
5. Click the Formula field, type =, then right-click and select Paste. Tekla Structures pastes the reference to flange thickness from the Clipboard. Now enter *0.5. Formula should now
=fP(Flange thickness 1.1525)*0.5.
6. Set other values:
•
Variable type = Parameter•
Value type =Length•
Visibility = Hide7. In the Custom component browser, click Component Objects > Weld > General properties and right-click Size above line and select Add equation. Type in after the equal sign "w".
8. Click OK button to close the dialog box.