home - about - advertise     
 
 
Sponsors
Navigation
Partners

 
AutoCAD Tutorial

AutoCAD 2004 Customization Tutorial: Operating System Commands

By Alireza Parsai, May 29, 2003

AutoCAD Program Parameters file or rather ACAD.PGP enables users to call external operating system commands through AutoCAD command line. You can edit ACAD.PGP with the help of Notepad or any other text editor. Follow the instructions to open ACAD.PGP in Notepad and add a new external command to AutoCAD. The current tutorial has many common steps with the following one:

Defining 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

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


Figure 6

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

17. Close the dialog box and scroll down. Read through the comments to learn more on defining external commands.

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 External Commands

20. Add the following alias definition [Figure 7]. The blank spaces are optional.

EXCEL, START EXCEL, 1,,


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 EXCEL and then press Enter. The Microsoft Excel window appears.

Note: If Microsoft Excel is not installed on your computer, replace the line with the following one. Thus the Notepad will start by entering NP in command line.

NP, START NOTEPAD, 1,,


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 >>

 

Newsletter

Get all the week's articles
FREE!
(current issue)