UI Customization in Mechanical

The attributes begingroup and contextgroup are available on <load>, <result>, and <object> tags. You can use these attributes to add separators and groups in your context menus.

  • Setting the attribute begingroup to true adds a separator before the entity in the context menu. The default value for begingroup is false.

  • Specifying the name of a menu group for the attribute contextgroup causes the entity to appear in this group. When no group is specified, the entity is put at the root of the context menu.

The following code demonstrate how to use these attributes:

<load name="Load1" version="1" caption="Load 1" icon="tload" issupport="false" isload="true" contextgroup="Group 2" color="#0000FF">
    <property name="Geometry" control="scoping" />
</load>
<load name="Load2" version="1" caption="Load 2" icon="tload"  issupport="false" isload="true" color="#0000FF" contextgroup="Group 1">
    <property name="Geometry" control="scoping" />
</load>
<load name="Load3" version="1" caption="Load 3" icon="tload" issupport="false" isload="true" color="#0000FF" begingroup="true">
    <property name="Geometry" control="scoping" />
</load>
<load name="Load4" version="1" caption="Load 4" icon="tload" issupport="false" isload="true" contextgroup="Group 2" color="#0000FF">
    <property name="Geometry" control="scoping" />
</load>
<load name="Load5" version="1" caption="Load 5" icon="tload" issupport="false" isload="true" color="#0000FF" begingroup="true">
    <property name="Geometry" control="scoping" />
</load>
<load name="Load6" version="1" caption="Load 6" icon="tload" issupport="false" isload="true" color="#0000FF" contextgroup="Group 1" begingroup="true">
    <property name="Geometry" control="scoping" />
</load>
<load name="Load7" version="1" caption="Load 7" icon="tload" localize="true" isload="true" color="#0000FF">
    <property name="Geometry" control="scoping" />
</load>

 

 

 


Note:  All context groups defined for a given extension are at the bottom of the context menu section for the given extension. The context group order is determined by the order in which they are defined in the extension's XML file. For example, in the preceding images, Group 2 comes before Group 1 because Group 2 is defined before Group 1.