General InformationThis opening ID is used to customize the section of the Shortcut Menu that contains app-specific commands (that is, the commands managing functional and logical objects). In this section of the Shortcut Menu, you can:
The table below provides you with information related to the definition of the opening ID.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
Declare the File Containing the ScriptTo customize the Shortcut Menu, you must declare the file containing the script to be
executed in PLMBusinessLogicFLEditor.CATRuleExit: In this example, the script The string
Create a Script for the Customized Shortcut MenuThe Shortcut Menu is described in a new script, in a
The attribute "MenuCmdList" is assigned to this list of lists. Example: To create a list of lists called MenuList, the
Parameters->SetAttributeObject("MenuCmdList", MenuList)
By default, the attribute To obtain this default menu content, you must enter:
let MenuList (List) set MenuList = Parameters->GetAttributeObject ("MenuCmdList")
In the list of lists, each entry corresponds to a line in the Shortcut Menu:
Sample to Add a New CommandThe following script sample explains how to add a new command in the Shortcut Menu.
let MenuList(List) let CurrentMenuItem(List) let CurrentCommand(String) set MenuList = Parameters->GetAttributeObject ("MenuCmdList")
CurrentCommand = "SEPARATOR" CurrentMenuItem.RemoveAll() CurrentMenuItem.Append(CurrentCommand) MenuList.Append(CurrentMenuItem) CurrentCommand = "CATRFLPLMPropagateToEditionCmdHdr" CurrentMenuItem.RemoveAll() CurrentMenuItem.Append(CurrentCommand) MenuList.Append(CurrentMenuItem) CurrentCommand = "CATRFLPLMPropagateToReadOnlyCmdHdr" CurrentMenuItem.RemoveAll() CurrentMenuItem.Append(CurrentCommand) MenuList.Append(CurrentMenuItem) Parameters->SetAttributeObject("MenuCmdList", MenuList)
Sample to Remove Standard New CommandsThe following sample explains how to add a new command in the Shortcut Menu.
let MenuList(List) let CurrentMenuItem(List) let ItemSize(Integer) let CurrentCommand(String) let i(Integer) set MenuList = Parameters->GetAttributeObject ("MenuCmdList")
i=MenuList.Size() for i while i>0 {
set CurrentMenuItem = MenuList.GetItem(i) set ItemSize = CurrentMenuItem.Size() if (ItemSize == 1) {
set CurrentCommand = CurrentMenuItem.GetItem(1) if (CurrentCommand == "CATPLMEditorInsertNewReferenceCmdHdr") {
MenuList.RemoveItem(i) } else if (CurrentCommand == "CATPLMEditorInsertExistingReferenceCmdHdr") {
MenuList.RemoveItem(i) } else if (CurrentCommand == "CATPLMEditorInsertNewFunPortCmdHdr") {
MenuList.RemoveItem(i) } else if (CurrentCommand == "CATPLMEditorInsertNewFunConnectionCmdHdr") {
MenuList.RemoveItem(i) } } i = i-1 } Parameters->SetAttributeObject("MenuCmdList", MenuList)
Sample to Create SubmenusThe following sample explains how to create submenus in the Shortcut Menu.
let MenuList(List) let CurrentCommand(String) let FLEditabilitySubMenu(List) set MenuList = Parameters->GetAttributeObject ("MenuCmdList")
CurrentCommand = "EditabilitySubMenu" FLEditabilitySubMenu.Append(CurrentCommand) CurrentCommand = "CATRFLPLMPropagateToEditionCmdHdr" FLEditabilitySubMenu.Append(CurrentCommand) CurrentCommand = "CATRFLPLMPropagateToReadOnlyCmdHdr" FLEditabilitySubMenu.Append(CurrentCommand) MenuList.Append(FLEditabilitySubMenu) Parameters->SetAttributeObject("MenuCmdList", MenuList)
The EditabilitySubMenu.Title = "Editability..." Sample to Apply Different Scripts on Different Customized TypesTo apply different Shortcut Menus on different customized types, there are two methods:
| |||||||||||||||||||||||||