사용자 정의 명령 정의 예
예: 특성 대체를 사용하여 URL의 부품 대체
이 사용자 정의 명령은 레이블이 Button Label이고, 도구 설명이 있습니다. 또한 이 명령을 활성화하는 경우 지정된 특성(Source_file_name)에 대해 현재 선택한 부품을 확인합니다. 찾지 못하는 경우 버튼을 사용할 수 없습니다. 찾는 경우 URL의 하위 문자열을 이 부품으로 대체합니다
<menu
ui="rmb"
view="all"
pane="all"
select="any"
visible="getSelectedCount()==1 && getPropertyExists('Source_file_name')">
<command_name >MyCommand 1</command_name>
<label >Button Label</label>
<tooltip>This is a new command.</tooltip>
<icon>\my\icons\location\icon16x16.png</icon>
<action
target="browser">
http://somewhere.com/content.jsp?partName=<!Source_file_name!>
</action>
</menu>
예: 여러 부품을 선택한 경우 URL의 부품 대체
이 예에서는 사용자가 부품 2개를 선택할 때 Creo View가 Featrue_Id에서 반환된 두 부품의 getSelectedPartProperty 특성 값을 불러옵니다. 그런 다음 URL의 두 하위 문자열을 이 값으로 대체합니다.
<menu
ui="rmb"
view="all"
pane="all"
select="any"
visible="getSelectedCount()==2 && getSelectedPartProperty(1,'Feature_Id','featureId1') &&
getSelectedPartProperty(2,'Feature_Id','featureId2')">
<command_name >MyCommand 2</command_name>
<label >Button Label</label>
<action
target="browser">
http://www.somewhere.com/index.jsp?Id1=<!featureId1!>&Id2=<!featureId2!>
</action>
</menu>