How to hide and grey out user-defined attributes

Tekla Structures
Not version-specific
Tekla Structures
Environment
Not environment-specific
Question:
Is it possible to hide or grey out user-defined attributes in objects.inp?

Answer:
Yes, it is possible with the toggle_field definition. Add the toggle_field definition to the end of the attribute definition whose values affect other attributes. The format is

toggle_field:[!]field1=gray_out_value1,gray_out_value2;

To grey out an attribute, use just the attribute name. To hide an attribute, use ! before the attribute name. The same definition works also for custom components.

See the examples below:
Grey out
When the user selects the first item (first item in the list is always 0, second in the list is 1, etc. ) in the element weight (ELEMENT_WEIGHT) list, then the unit weight (UNIT_WEIGHT) attribute is greyed out.

attribute("ELEMENT_WEIGHT", "", option,"%s", no, none, "0.0", "0.0",250,650,200, "toggle_field:UNIT_WEIGHT=0")
Hide
In this example, the form thickness (C_FORM_THICKNESS) field is hidden (!) when the form material (C_FORM_MATERIAL) is selected to be the first (0), third (2) or fourth (3) option in the list. Form thickness stays visible only when the second (1) option, Plywood, is selected.

attribute("C_FORM_MATERIAL", "j_Form_material", option, "%s", yes, none, "0.0", "0.0",374, 196, 160, "toggle_field:!C_FORM_THICKNESS=0,2,3")
Image
toggle_field_example2.png
Image
toggle_field_example2B.png


Pictures

You can also hide pictures. If the picture name is defined in objects.inp without the .bmp file extension, you need to use the same extension as Tekla Structures uses internally: .xbm:
“toggle_field:!dia_part_move_end_1.xbm=1”

See also

Example: Dim unavailable options
Was this helpful?