|
|  |
AutoCAD Tips & Tutorials
Tutorial: Create a custom command
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.
- 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:
| Character |
Description |
| 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. |
| ^P |
Toggles the display of the menu macro on the command line; makes the macro look neater when you use it. |

- From the Command List Categories drop-down list, choose Custom Commands to easily find your command. Select it and drag it to the desired menu or toolbar at the top of the Customize User Interface dialog box.
- If you drag it to a toolbar, use the Button Editor to give it an image. Usually, you choose an existing button to start with, click Edit, and modify it. Then click the Save As button to save the icon image.
- Click OK and try out your new command!
Back to main tips menu for more tips
|
|
|
Books by Ellen
|
New!
AutoCAD 2009 and AutoCAD LT 2009 Bible
This is the 9th edition of this book! Completely updated to conform to the new interface and, of course, it covers all the new features, such as the ribbon, Quick View, ShowMotion, the View Cube, the SteeringWheel, and more. |
AutoCAD 2008 and AutoCAD LT 2008 Bible
Learn the great new features with wide application to all disciplines. Get the most comprehensive book on AutoCAD! DVD contains a 30-day trial of AutoCAD and AutoCAD LT. Thorough exercises guide you through each feature.
|
|
AutoCAD 2007 and AutoCAD LT 2007 Bible
Discover the 2007 features, especially the radically improved 3D tools. CD has AutoCAD 30-day trial, 3rd-party software, and drawings for exercises.
|
AutoCAD 2006 and AutoCAD LT 2006 Bible
Understand and use the 2006 features,
including dynamic blocks and the new method of
customizing menus and toolbars. CD-ROM
has AutoCAD trial, software, and
drawings for all exercises. |
|

AutoCAD 2005 and AutoCAD LT 2005 Bible
Fully explains latest
2005 features: tables,
fields, and sheet sets. For the first
time, covers AutoCAD LT! CD-ROM
comes with software and
drawings for all exercises.
|
|

AutoCAD 2004 Bible
Covers all features
in detail. Hands-on exercises. Over
1300 pages + CD-ROM with software and
drawings for all exercises.
|
|