Subject: Using macros in .cui files

Macros in .cui files can run commands with custom options for tool palettes, menus, the ribbon (for versions that have a ribbon), toolbars, keyboard shortcuts, and aliases. For example:


This example zooms to extents, saves the file, and then prints the file.

You can add macros to .cui files manually using a text editor and also in the Proper­ties area of the Customize dialog box. For example, to add a macro to a menu item, see Setting properties of menu items.

The following table describes special characters that can be included in macros that are used in .cui files.





Equivalent to pressing the Enter key. For example, adding ; or ^M advances to the next prompt:




Equivalent to pressing the Esc key. Adding three ^C (Ctrl+C) characters before a command cancels any active commands or dialog boxes. For example:


Note that ^C is ignored if used outside of a command; it doesn't clear the selection.


Equivalent to pressing the Ctrl key. Adding a carrot before a character runs the equivalent shortcut, for example, to toggle entity snapping on or off:



Suppresses the display of all prompts and input for the subsequent command.


Suppresses the display of all prompts and input for all subsequent commands.

blank space

Equivalent to entering a space, for example, a blank space between commands is the same as pressing the Spacebar or the Enter key.


Accesses the original or default command if it was undefined using the Undefine command. For example:



Uses the default English translation for subsequent commands and options. This allows the macro to run on all languages. For example:



Runs the command line version of the command instead of the dialog box version. This is useful when running commands in scripts. For example:


Runs the command transparently, i.e., within a running command. For example:



Repeats the subsequent command or entire macro until another command is run or the user cancels it. For example:



Displays the current top-level user interface item.


Starts a DIESEL routine. For example:



Inputs the coordinates of the previously specified point. For example:



Turns snaps on or off by toggling the SNAPMODE system variable. For example:



Forces a cancel. Can be used outside of a command to clear a selection.


Sets the isometric plane to the next option (Top, Right, or Left) by setting the SNAPISOPAIR system variable. Equivalent to F5 and Ctrl+E.


Turns the reference grid on or off by toggling the GRIDMODE system variable. Equivalent to F7 and Ctrl+G.


Turns orthogonal mode on or off by toggling the ORTHOMODE system variable. Equivalent to F8 and Ctrl+L.


Turns menu echo mode on or off by setting the MENUECHO system variable.


Turns tablet mode on or off by toggling the TABMODE system variable.


Activates the next viewport which affects the CVPORT system variable.

© Copyright 2023. BackToCAD Technologies LLC. All rights reserved. Kazmierczak® is a registered trademark of Kazmierczak Software GmbH. Print2CAD, CADdirect,, CAD Direct,, CAD Bot, are Trademarks of BackToCAD Technologies LLC. DWG is the name of Autodesk’s proprietary file format and technology used in AutoCAD® software and related products. Autodesk, the Autodesk logo, AutoCAD, DWG are registered trademarks or trademarks of Autodesk, Inc. All other brand names, product names, or trademarks belong to their respective holders. This website is independent of Autodesk, Inc., and is not authorized by, endorsed by, sponsored by, affiliated with, or otherwise approved by Autodesk, Inc. The material and software have been placed on this Internet site under the authority of the copyright owner for the sole purpose of viewing of the materials by users of this site. Users, press or journalists are not authorized to reproduce any of the materials in any form or by any means, electronic or mechanical, including data storage and retrieval systems, recording, printing or photocopying.