Create a Shortcut Menu
ConceptProcedureQuick Reference


Your Ad Here

 
 
 

Shortcut menus are displayed at your cursor location when you right-click a pointing device. The shortcut menu and the options it provides depend on the pointer location and other conditions, such as whether an object is selected or a command is in progress. You can also use scripts to display shortcut menus.

Context-sensitive shortcut menus display menu options when you right-click that are relative to the current command or the selected object.

Shortcut Menu Aliases

Shortcut menus are referenced by their aliases and are used in specific situations. In the Customize User Interface editor, the alias names must follow the proper naming conventions. For example, the shortcut menu named “Default Menu” displays the following information in the Aliases section of the Properties pane:

POP501, CMDEFAULT

The Object Snap shortcut menu must have an alias of POP0. Aliases for context-sensitive shortcut menus must be numbered between POP500 and POP999. The following aliases are reserved for use by the program:

Program aliases for shortcut menus

Alias

Description

GRIPS

Defines the Hot Grip shortcut menu. (Right-click the drawing area while a grip on an object is selected.)

CMDEFAULT

Defines the Default mode shortcut menu. (Right-click the drawing area while no command is active and no objects are selected.)

CMEDIT

Defines the Edit mode shortcut menu. (Right-click the drawing area while one or more objects are selected, no grips are selected, and no command is active.)

CMCOMMAND

Defines the Command mode menu. (Right-click the drawing area while a command is active.) In addition to the content of the CMCOMMAND menu, the command’s options (keywords within the square brackets) are inserted into this menu.

SNAP

Defines the Object Snap menu. (SHIFT+right-click the drawing area.)

The CMEDIT and CMCOMMAND shortcut menus can be made context-sensitive. In addition to the content of the CMEDIT menu, the appropriate object menu (if it exists) is inserted into this menu when one or more of a specific object type are selected. Object menus use either of the following naming conventions: OBJECT_objectname

OBJECTS_objectname

If a single object is selected, the OBJECT_objectname menu is used, and if more than one of the same object is selected, the OBJECTS_objectname menu is used. If no OBJECT_objectname is available, the program uses the OBJECTS_objectname menu (if it exists).

The object name is the drawing interchange format (DXF) name of the object in all cases except for the inserted object. The following table shows the object names that are specific to blocks, dynamic blocks, and xrefs.

Object names specific to inserted objects

Object Name

Description

BLOCKREF

Block reference without attributes

ATTBLOCKREF

Block reference with attributes

DYNBLOCKREF

Dynamic block reference without attributes

ATTDYNBLOCKREF

Dynamic block reference with attributes

XREF

External reference (xref)

For example, to support an object-specific shortcut command for one or more selected block references, you would add the following properties on the Customize tab, Properties pane of the Customize User Interface editor:

Properties for the Block Reference Objects shortcut menu

Properties pane item

Description

Example

Name

String that is only used in the CUI editor and is not displayed in the user interface.

Block Objects Menu

Description

Text used to describe the element; does not appear in the user interface.

Shortcut menu for block objects

Aliases

Specifies the aliases for the shortcut menu. Click the ellipses button [...] to open the Aliases dialog box. Each alias in the CUI file should be unique and it is used to reference the shortcut menu programatically.

POP512,OBJECTS_BLOCKREF

Element ID

Tag that uniquely identifies a shortcut menu.

PM_0021

Like the CMEDIT menu, the CMCOMMAND menu can contain context-sensitive information. Any menu named COMMAND_commandname is appended to the CMCOMMAND menu. The text of commandname can be any valid AutoCAD command, including custom-defined or third-party commands.

In many cases, you can enter a hyphen before a command to suppress the display of a dialog box and display prompts for the command instead. To create a context-sensitive menu for a command that displays prompts instead of a dialog box (such as -INSERT), you need to name the menu COMMAND_-INSERT.

See Also

Return to Autodesk Index


Your Ad Here