Customization > Extensibility Through Profiles, Stereotypes, Tag Definitions and Scripts > Advanced extensibility through stereotype scripts and script items > Extending context menu commands through stereotypes and scripts > Overview of extending context menu commands through stereotypes and scripts
  
Overview of extending context menu commands through stereotypes and scripts
You can create your own context menu commands for items and diagrams, and hide the New and Populate submenu commands for items and diagrams.
Creating your own context menu commands
For items, the context menu command can appear when you right-click the item or its symbol on a diagram. For diagrams, the context menu command appears when you right-click the diagram in a Modeler pane or right-click the background of an open diagram.
When a user clicks a context menu command you have created, Modeler runs its associated script. The script can use the Modeler automation interface to perform numerous tasks within Modeler. The object you right-clicked is passed to the script as the current object.
You can create context menu commands through Scripts or Stereotypes:
If you want the context menu command to be always available for all items of specified types, use a Script.
If you want the context menu command to be available only for items that are directly stereotyped by a specific Stereotype, use that Stereotype to define that context menu command.
* 
The 'Apply to All Objects of Associated Model Item Types' option does not apply a Stereotype's context menu commands to any items.
For an item, the Context property determines when the context menu command appears:
Universal - menu command appears when the item is right-clicked anywhere in Modeler.
DictItem - menu command appears when the item is right-clicked in a pane or the Property Pages only.
SymbolOnly - menu command appears when the item is right-clicked on a diagram only.
Note that when the Command Context property is set SymbolOnly, the command is available only when a diagram is locked (editable). When the command context is set to Universal, the command is available when a diagram is locked and unlocked, but Modeler will prevent the command from making changes to an unlocked diagram.
When the context menu command is created through a Stereotype and the Context property is set to Universal or SymbolOnly, you can additionally specify the diagram types for which the context menu command is shown through the Applicable Diagram Types property.
You can add a shortcut to your command by prefixing the shortcut letter with an ampersand. For example: &My Command
You can group customized menu commands so that they appear together, and order the commands within that group.
You can add a separator before the command through the Separator Before property.
Hiding new and populate submenu commands
If you create your own commands for creating new items or in the case of diagrams, adding or populating items; you may want to hide the Scope to Package command and the standard creation and populate commands that appear on the following submenus in Modeler:
Diagram menu > Populate submenu
Context menu > Populate submenu
Context menu > New submenu
Context menu > Roll Up, Roll Up Features, and Roll Up Contextual Features commands
You can hide the Scope to Package command, and the preceding submenus and their commands through the Hide Creation Commands check box on the Directly-Stereotyped Options tab of a Stereotype's Property Pages. When the Stereotype is applied directly to an item the New and Populate submenus are hidden on that item's content menu.
* 
Note that the Hide Creation Commands does not hide any variability commands.
Selecting the 'Apply to All Objects of Associated Model Item Types' check box for a Stereotype does not hide the New or Populate submenus on any items.
Hiding extended context menu commands
On occasions you may want to hide extended context menu command that have been added to an item or diagram.
When a Stereotype is applied to an item or diagram, you can hide the extended context menu commands through the Hide Custom Meta Type Menus property of the Stereotype.