v11.0 (2013)
Adds a menu item at the end of the menu and attaches a command. This method is similar to Menu.AddCommandItem but specific to the python language.
Object Menu.AddCommandItem2( String in_pLabel, Object in_cmd ); |
oReturn = Menu.AddCommandItem2( Label, Command ); |
The newly created MenuItem object.
Parameter | Type | Description |
---|---|---|
Label | String | The menu item label. |
Command | String or Command | The name of a command or a command object that will be invoked when the menu item is selected. This is the real name (SIObject.Name) of the command, not the Command.ScriptingName. You can find the Name of a command by running it and then checking the Edit menu (where the Name of the last executed command always appears after 'Repeat' and 'Undo'). Commands are also listed by name in the customize toolbar dialog and the scene explorer. |
MenuItem Command Command.Enabled Command.ScriptingName MenuItem.Command ArgumentCollection.AddWithHandler siMenuAnchorPoints Definition Callbacks for Menus Simple Menu plug-in example