Adds a menu item at the end of the menu and attaches a command. The command
is fired when the menu item is selected. You can attach any native or custom
commands you want to a menu item. If your menu is attached to a contextual
menu and one of your command's arguments takes the selected object(s) by
default, then the currently selected objects is passed to your command. The
target object under the cursor is also passed in as part of the selected
objects. However if no objects are selected, then only the target is passed
in. See ArgumentCollection.AddWithHandler for defining a
custom command's argument that takes the selected objects by default.
Tip: See any of the examples for creating a
Simple Menu plug-in
to see this method in action.
Note: This method could return an invalid object in python, use Menu.AddCommandItem2 instead.