Tags
root
根标记必须始终是.xml层次结构的基标记,并将所有标记放在其中。
Attributes
translationcontext
Children
page, actionlist
page
表示功能区上的选项卡。
Attributes
tag, text, spotlighttext, tooltip, visible, homepage, helpcommand
Children
group
Example XML
<root>
<page tag="HMX_Assembly" text="Assembly">
...
</page>
<page tag="HMX_Geometry" text="Geometry">
...
</page>
<page tag="HMX_Mesh" text="Mesh">
...
</page>
</root>
group
组容器,用于组织按垂直分隔符划分的操作组。
Attributes
tag, text, spotlighttext, tooltip, visible
Children
actiongroup, menu
Example XML
<page tag="HMX_Assembly" text="Assembly">
<group tag="HMX_Organize_G" text="Organize">
...
</group>
<group tag="HMX_Parts_G" text="Parts">
...
</group>
</page>
actiongroup
用于组织一组操作的操作组容器。
Attributes
tag, text, spotlighttext, tooltip, visible, type, defaultaction, dropdownsmallicons
Children
spriteaction, secondaryribbon
Example XML
<page tag="HMX_Assembly" text="Assembly">
<group tag="HMX_Organize_G" text="Organize">
<actiongroup tag="HMX_Organize_AG" text="Organize">
...
</actiongroup>
<actiongroup tag="HMX_Collaborate_AG" text="Collaborate">
...
</actiongroup>
<actiongroup tag="HMX_ID_Manager_AG" text="ID Manager">
...
</actiongroup>
</group>
</page>
actionlist
列出所有spriteaction标签的容器。任何新的动作都应该放在其中。
Attributes
None
Children
action
action
动作组中的单个动作。动作列表中的每个新spriteaction标签都应该包含来自现有标签的唯一属性。如果新的动作标记不是唯一的,那么应该在页面中需要的地方引用已经存在的标记。
Attributes
Inside actionlist tags: tag, text, tooltip, image, command, picmask, spotlighttext, enabled, linktoe
Inside page tags: actiontag, visible, assatellite, xoffset (with assatellite)
Children
none
Example XML
<root>
<actionlist>
<action tag="HMX_Collaborate" text="Collaborate" tooltip="Collaboration Tools"
image="ribbonCollaborateStrip-80.png" command="tcl: ::hw::OpenDataManager"/>
<action tag="HMX_Subscribe" text="Subscribe" tooltip="Subscribe"
image="ribbonSatelliteSubscribeStrip-80.png" command="tcl: ::hw::InitSubscribe"/>
...
</actionlist>
<page tag="HMX_Assembly" text="Assembly">
<group tag="HMX_Organize_G" text="Organize">
...
<actiongroup tag="HMX_Collaborate_AG" text="Collaborate">
<action actiontag="HMX_Collaborate"/>
<action actiontag="HMX_Subscribe" assatellite="True"/>
</actiongroup>
...
</group>
</page>
</root>
secondaryribbon
扩展到次要操作组的单个操作。
Attributes
tag, text, spotlighttext, tooltip, visible, command, assatellite, enabled, linkto, picmask, image
Children
action
Example XML
<root>
<actionlist>
<action tag="HMX_Parts" text="Parts"
image="ribbonPartsStrip-64.png"
command="tcl: ::hm::context::listentityreview::PostEE Part"/>
<action tag="HMX_PartsAssems" text="Part Assems"
image="ribbonAssembliesStrip-64.png"
command="tcl: ::hm::context::listentityreview::PostEE PartAssembly"/>
...
</actionlist>
<page tag="HMX_Assembly" text="Assembly">
...
<group tag="HMX_Parts_G" text="Parts">
...
<actiongroup tag="HMX_Parts_AG" text="Parts" tooltip="">
<secondaryribbon tag="HMX_Parts_SR" text="Parts"
image="ribbonPartsStrip-80.png">
<spriteaction actiontag="HMX_Parts"/>
<spriteaction actiontag="HMX_PartAssems"/>
</secondaryribbon>
</actiongroup>
...
</group>
...
</page>
</root>
menu
放置在组文本右侧的下拉菜单。
Attributes
Visible
Children
action, separator
separator
Horizontal separators inside of drop-down menus.
Attributes
Visible, text, tooltip
Children
None
Example XML
<page tag="HMX_Connectors" text="Connectors">
<group tag="HMX_Create_G" text="Create">
...
<menu>
<action actiontag="HMX_ConnectorPanels"/>
<separator/>
<action actiontag="HMX_Absorption"/>
<action actiontag="HMX_AutoPitch"/>
<action actiontag="HMX_Comparison_1"/>
<action actiontag="HMX_Quality"/>
<action actiontag="HMX_HoleDetection"/>
<separator/>
<spriteaction actiontag="HMX_ConnectorOptions"/>
</menu>
</group>
</page>
if
条件语句,根据提供的表达式显示/隐藏其中包含的所有标记。
Attributes
eval
Children
page, group, actiongroup, action, menu, separator
Operators
==, !=, <, > <=, >=, in, ni
Format
eval="expr: $ENVIRONMENT_VARIABLE == VALUE"<br>
eval="expr: $HM_UNITS > 1"<br>
eval="tcl: ::HM_Framework::SomeProc %T"<br>
eval="py: hwf.frwk.test()"Example XML
<page tag="HMX_Assembly" text="Assembly">
<if eval="expr: $PLATFORM == win64">
<group tag="HMX_Parts_G" text="Parts">
<if eval="tcl: ::HM_Framework::SomeProc %N %T">
<action actiontag="HMX_Assemblies"/>
</if>
<if eval="py: hwf.frwk.test()">
<action actiontag="HMX_Verification"/>
</if>
</group>
</if>
</page>
Output
当环境变量platform设置为win64时,Parts组才会显示。只有当.tcl和Python命令返回true时,才会显示Assemblies和Verification操作。