About Controlling the Display of Ribbon Buttons

The way a ribbon button is displayed indicates its availability in the program.

A ribbon button can be displayed as:

Note: To mark ribbon buttons, the “~” or “!.” sequence cannot be placed before a command name explicitly; it must be inside a DIESEL expression.

Gray Out (Disable) Ribbon Buttons

You can gray out a ribbon button by using a DIESEL string expression.

When grayed out, the macro and submenus associated with the ribbon button are made inaccessible.

The following DIESEL string expression, placed in the Macros property of the Properties pane, disables the macro while another 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 AutoLISP application. (Not available in AutoCAD LT.)

Mark Ribbon Buttons

You can mark a ribbon button by using a DIESEL string expression.

When a ribbon button is marked, a border is displayed around the image.

DIESEL string expressions can be used to conditionally mark a ribbon button each time it is displayed. The following DIESEL string examples, when added to the Macros property of the Properties pane, highlight the ribbon button when the related system variable is enabled.

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

Simultaneously Disable and Mark Ribbon Buttons

You can mark and disable a ribbon button at the same time using either of the following formats:

~!.labeltext
!.~labeltext