Control the Display of Command Labels (Concept)

AutoCAD

 
Control the Display of Command Labels
Concept Procedure Quick Reference
 
 
 

You can control the way that menu labels indicate a command's availability in the program. Display menu commands as grayed out (disabled), mark them with a check mark or border, or use a combination of indicators.

Menu commands can also contain DIESEL string expressions that gray out, mark, or interactively change the text of the displayed label. For more information about using DIESEL expressions, see DIESEL Expressions in Macros.

Gray Out (Disable) Menu Labels

To gray out a label in a menu, you begin the command name with a tilde (~). Any commands associated with the item are not issued, and submenus are inaccessible.

In the following example, the tilde (~) is placed at the beginning of the Copy Link command label in the Name cell of the Properties pane.

Following is the resulting Copy Link command grayed out in the Edit menu.

Command labels can contain DIESEL string expressions that conditionally disable or enable command labels each time they are displayed. For example, the DIESEL string expression in the Macros cell of the Properties pane disables the MOVE command while any other command is active.

$(if,$(getvar,cmdactive),~)MOVE^C^C_move

The AutoLISP menucmd function can also be used to disable and enable items from a macro or application. For examples, see Reference Pull-Down or Shortcut Menus.

Mark Menu Labels

You can mark a menu label by including an exclamation point and a period (!.) in the Name cell of the Properties pane for the command. A menu item is marked in one of two ways:

  • A check mark. Displayed when a menu item does not have an image associated with it.
  • A border. Displayed when a menu item has an image associated with it; a border is displayed around the image.

Following is an example of the Edit menu with the OLE Links command marked with a check mark and the Copy Link command's image marked with a border:

Command labels can also contain DIESEL string expressions that conditionally mark command labels each time they are displayed. When the following DIESEL string is added to the Macros cell for the applicable command in the Properties pane, a check mark is placed to the left of the menu label whose related system variable is currently enabled.

$(if,$(getvar,orthomode),!.)Ortho^O
$(if,$(getvar,snapmode),!.)Snap^B
$(if,$(getvar,gridmode),!.)Grid^G

The AutoLISP menucmd function can be used to mark labels from a macro or application. For examples, see Reference Pull-Down or Shortcut Menus.

Simultaneously Disable and Mark Command Labels

You can mark and disable commands at the same time using either of the following formats:

~!. labeltext
!.~ labeltext

The tilde (~) is the special character code to disable a command and an exclamation point and period (!.) is the special character code to mark a command.

The tilde (~), exclamation point, and period (!.) are placed at the beginning of the Copy Link command label in the Name cell of the Properties pane. Following is the resulting Copy Link marked and grayed out in the Edit menu.

As with the previous examples, a DIESEL expression can be used to simultaneously disable and mark a command label.