If you find yourself using the same combination of commands and options over and over, you can easily create a custom command that executes the combination with a click of a button or a menu item. In this tutorial, I explain the basics of AutoCAD’s menu syntax so that you can create your own commands. No programming required!

Enter CUI at the command line/dynamic tooltip to open the Customize User Interface dialog box.

In the Command List pane, click New (Create a New Command).

In the Properties pane, enter a name for the command in the Name text box. Also enter a description in the Description text box.

If you think your command will be long or need more than one line, click in the Macro text box and then click the Ellipsis button that appears on the right. Then enter your macro in the Long String Editor dialog box. Otherwise, enter the macro in the Macro text box. Start by writing out the combination of commands and options as you would enter them on the command line or in a script. Then add any necessary special characters.

Below are the special characters you need to know for menu macros:

< Space >Equivalent to pressing Enter except when entering text to create a text object that contains spaces (between words). Use between the command and its options.

;(semi-colon) Equivalent to pressing Enter. The end of a line in a menu macro is also equivalent to pressing Enter. More helpful than using a space when you need to press Enter twice, because it shows the number of Enters more clearly. Also helpful at the end of the macro.

\ Pauses for user input, such as picking a point or entering a value.

​+ At the end of a macro line, continues the macro to the next line

* At the beginning of a macro, before ^C^C, repeats the macro until you press Esc or choose another menu item.

^PToggles the display of the menu macro on the command line; makes the macro look neater when you use it.

I really like using AutoCAD's LENGTHEN command. And when I use it, I *only* use it Dynamically, so I've created a new macro into a new button that I can use that will automatically start the Lengthen command and step through the selection of Dynamic and let me pick that line that I want to work on.

​

First, type CUI to bring up the Customize User Interface, and then select the CREATE A NEW COMMAND button as shown above. A new command will be created called COMMAND1 (or COMMAND2, or COMMAND3...)Select the COMMAND1 command from the Command List pane, just below you Create A New Command button.This will populate the PROPERTIES area for the command.

Under PROPERTIES I called my new Command LDY and wrote a brief description.At the MACRO area it reads: ^C^C_lengthen;dy;[which basically tells AutoCAD Cancel Cancel. Start the LENGTHEN command <enter> DYnamic <enter>I also stole the default lengthen button image.

Lastly, I added my new command to a newly created Toolbar Menu. You can add your new command to any Toolbar menu.