home - about - advertise     

AutoCAD Tutorial

AutoCAD 2004 Customization Tutorial: Defining a New Command Alias

By Alireza Parsai, May 28, 2003

Command aliases are alternative names for AutoCAD commands. For example you can invoke the LINE command by entering L in command line. The AutoCAD Program Parameters file or rather ACAD.PGP is used to define command aliases. Here you learn how to open and modify this file to add a new command alias.

1. Start AutoCAD 2004 if necessary.

2. Invoke OPTIONS command.

3. Select Files tab.

4. Click the + sign beside Support File Search Path.

5. Select the long path that leads you to the Support file [Figure 1].

Figure 1 - Click on image to enlarge

6. Press F2 to make the path text selectable.

7. Press Ctrl+C to copy the path to Windows clipboard.

8. Click Cancel to close the Options dialog box.

9. In command line enter Notepad and then press Enter twice. The Notepad window appears.

10. In Notepad press Ctrl+O to open a file. The Open dialog box appears [Figure 2].

Figure 2 - Click on image to enlarge

11. Double-click in the File name box.

12. Press Ctrl+V to paste the content of clipboard in the text box [Figure 3].

Figure 3

13. Add \acad.pgp to the end of the text [Figure 4].

Figure 4

14. Click Open. The ACAD.PGP file appears in Notepad window [Figure 5].

Figure 5 - Click on image to enlarge

15. The file consists of two sections: external commands and command aliases. To find the command aliases section press Ctrl+F. The Find dialog box appears [Figure 6].

Figure 6

16. In Find what box type command alias format and then click Find Next.

17. Close the dialog box and scroll down. Read through the comments to learn more about defining aliases.

18. Press Ctrl+End to jump to the end of the file. Press Enter twice to insert two blank lines.

19. Type the following comment. Note that comment lines start with semicolon and are for your reference only.

; My Custom Aliases

20. Add the following alias definition [Figure 7]. The space between the comma and asterisk is optional.


Figure 7

21. Save the file.

22. Switch to AutoCAD.

23. To put the changes into effect you may exit and restart AutoCAD or use the REINIT command. Invoke REINIT. The Re-initialization dialog box appears [Figure 8].

Figure 8

24. Select PGP File option and then click OK.

25. In command line type VL and then press Enter. The Visual LISP window appears.

About the Author

Alireza Parsai is the founder of cadpanel.com. He is a mechanical engineer with more than 12 years experience with AutoCAD. Alireza is an Autodesk Authorized Author, the AutoCAD consultant for Al Khawarizmi Institute, a contributing editor for Augiworld magazine, a writer for CAD Digest, an instructor for AUGI Training Program, and an elected speaker for Autodesk University 2002. He has written 7 books in Farsi, 3 booklets in English, and more than 30 articles for different magazines and newsletters. You can reach him at alireza.parsai@cadpanel.com or visit his website www.cadpanel.com

More CAD Corner tutorials >>

CADdigest Weekly
Email (required) *

A week's worth of articles will be emailed to you. See latest issue .