Example: Dim unavailable options in a custom component dialog box

Tekla Structures
2021
Tekla Structures

Example: Dim unavailable options in a custom component dialog box

This example shows how to dim the unavailable options in the custom stiffener detail dialog box based on conditions. You can do this either in the custom component dialog editor or by editing the input (.inp) file manually.

In the beginning of this example all the options are available:

Define that the Left plate class text box is unavailable if only the right plate is created, and vice versa.

Dim unavailable options by using the dialog editor

  1. Create a custom stiffener detail with all the needed parametric variables that control the creation of stiffener plates.
  2. Open the stiffener dialog box for editing.
    1. In the model, select the custom stiffener detail.
    2. Right-click and select Edit Custom Component Dialog Box.
  3. Define that the Left plate class text box must be dimmed if only the right stiffener plate is created.
    1. In the Plates created list, select the image for the right plate class.

      Note that a blue selection border must be displayed for the image:

    2. Hold down the Ctrl key and click the Left plate class text box.

    3. Click the Toggle visibility button.

      The Left plate class text box is now dimmed:

  4. Unselect the Left plate class text box by clicking the Right plate class text box.
  5. Define that the Right plate class text box must be dimmed if only the left stiffener plate is created.
    1. In the Plates created list, select the image for the left plate class.

      Note that a blue selection border must be displayed for the image:

    2. Hold down the Ctrl key and select the Right plate class text box.

    3. Click the Toggle visibility button.

      The Right plate class text box is now dimmed:

  6. In the dialog editor, click File > Save to save the changes.
  7. Close and reopen the model for the change to take effect.

Dim unavailable options by editing the .inp file

  1. Create a custom stiffener detail with all the needed parametric variables that control the creation of stiffener plates.
  2. In the model, click File > Open the model folder to open the current model folder.
  3. Go to the \CustomComponentDialogFiles folder.
  4. Open the .inp file in a text editor.
  5. Add the following line to the end of the attribute P4 line:

    "toggle_field:LeftC=0;RightC=1"

    The logic is the following:

    Selecting the image CC_left returns 0, CC_right returns 1, and CC_both returns 2.

    toggle_field:RightC=1

    When 0 (left) is selected, RightC is dimmed.

    toggle_field:LeftC=0

    When 1 (right) is selected, LeftC is dimmed.

  6. Save the .inp file.
  7. Close and reopen the model for the change to take effect.
Tip:

If you want to hide unavailable options instead of dimming them in the stiffener dialog box, add an exclamation mark in the conditions:

"toggle_field:!LeftC=0;!RightC=1"

The option is now completely hidden when unavailable:

Was this helpful?
Anterior
Seguinte