Wednesday
Autocad, Hints & Tips, ProgrammingCommand aliases in AutoCAD
AutoCAD 12 and higher versions
In support folder under AutoCAD install directory ( After AutoCAD 2005, directory is c:\Program Files\AutoCAD200x\Support ), there is a file named as acad.pgp. Short aliases that are used for AutoCAD commands are listed inside this file.

Fig. 1
Aliases of most of the commands can be found here. You can also edit this file, but you should definitely take a backup first. However, definitions here are aliases of standard commands and I suggest that you should not change the alias definitions. By this way, you can form up a common language with your friends in group works and computer sharing. Below, you can find alias definition format that is used in this file:
ALIASE, *COMMAND
It has a simple file structure. You can also add new lines to this file for your own aliases. You can assign more than one alias to a command. Thus, you don’t have to delete the original. Following set of commands is a good example for this:
L, *LINE
LI, *LINE
However, PGP file will be inadequate for the commands that have options. For example, you might think that, it would be a great idea to use ZE for ZOOM/EXTENTS command. You might even be using your own files. In order to make these kinds of aliases, we can use AutoLISP(TM). You can learn more about AutoLISP by looking at AutoLISP part of our website that is prepared by Orhan TOKER. Here, I will simply explain about ‘how to make a new command in AutoCAD’. First of all, we need an AutoLISP page. As this stage, you can get use of any text editor program( NOTEPAD.EXE ). Create a new file named as
“c:\Program Files\AutoCAD200x\Support\aliases.lsp“.
Now, add the following code into this file:
(defun c:ze() (command “_.ZOOM” “_E”) (princ))
If I roughly explain the logic, then it will be like this:
(defun c:ALIAS() (command “_.COMMAND” “OPTIONAL”) (princ))
If some certain commands, you have to press ENTER or SPACE buttons to complete the command. In order to achieve this, you have to use “” as an option. For example, for ERASE/ALL ( it is a dangerous command), you have to use the following code:
(defun c:EA() (command “_.ERASE” “_ALL” “”) (princ))
I would like to remind you once more that the code that is used in this example will delete all of the entities inside the drawing. By using this methodology, you can create aliases that is most suitable for your work style. (You can download the example file from here). Now, let’s take a look at how the file that we created will be automatically loaded when AutoCAD first opens:

Fig. 2
If you are not comfortable with this operation, then I suggest that you should take help from an expert. First of all, take a backup of the
“c:\Program Files\AutoCAD200X\Support\Acad200Xdoc.lsp“
file. Now, add the code that you can see in Fig. 2 at the end of this file ( Note: Download tal_macro.lsp file from here and copy into the
“c:\Program Files\AutoCAD200X\Support”
directory ). After this stage, save and close the file. From now on, every time you open AutoCAD, then you command aliases will be ready. In the following example, I am giving you the complete list of all of the aliases. Please try to understand the logic by using the tal_macro.lsp file, and make up your own list. The way of learning does not go though copying
Files : tal_macro.lsp
Technorati Tags: AutoCAD, command aliases, programming, AutoLISP
Viewed 10,663 times so far... This week: 96 Today: 18 Latest: 3 July 2009, 23:34Post Tags:
Related Posts
Popular
- Hip tip: Increasing view resolution with VIEWRES system variable
07/03/2009 04:39 am
7 Comments - Sirince – IZMIR
07/02/2009 11:02 am
1 Comment - Visual LISP: Programming user interfaces with OpenDCL
07/01/2009 10:15 pm
10 Comments - 3D Modeling 7: EXTRUDE
06/30/2009 02:14 pm
10 Comments - Ask DailyAutoCAD: Which Notebook to Buy?
06/30/2009 12:17 pm
1 Comment
Featured Articles
- AutoCAD 2009 Update 3 Released
- Speed Up As AutoCAD 2009 Ribbon Menu Helps You!
- MEP Analysis Extension for AutoCAD MEP extended to March 31, 2009
- Recap of AutoCAD-related technologies on Autodesk Labs
- Technology Preview of MEP Analysis Extension extended to 12/31/08
- Autodesk Labs: Forward and Backward utility for AutoCAD
|

Jun 12, 2007
Reply
When I try and alias a command, I get this error message
Command: ; error: malformed list on input
Here is the code that I’m using
_$ (defun c:RG() (command “REGION” pause pause pause pause “EXTRUDE” PAUSE)
I’m using it to join the lines together for the purpose of making a 3d object.
Any help would be appreciated..
Thank you.
Jun 14, 2007
Reply
Hi Adam,
You should add one right parenthesis at the end of the statement.
(defun c:RG() (command “REGION” pause pause pause pause “EXTRUDE” PAUSE))
May 5, 2008
Reply
Thanks
This is very useful
Is these similar listing of shortcuts or aliases using the control, alt, F1 F2 etc, or other keys
thanks again Christopher
Jun 4, 2008
Reply
I’m using AutoCAD 2008 and I can’t locate the file named as acad.pgp in my directory c:\Program Files\AutoCAD200x\Support. I only see acad.slb file in the directory.
Any help would be appreciated.
Thanks.
Jun 12, 2008
Reply
i find the easiest way to locate the pgp file is to open AutoCAD, then under tools > customize > click ‘Edit Program Parameters (acad.pgp)’
Make the necessary changes in here, then save and close the file. Now these changes wont take effect until you either restart autocad or type ‘reinit’ in the command line, then clcik the acad.pgp box to reinitialize autocad so it recognizes your changes.
Jul 31, 2008
Reply
I loaded 2008 on my computer without migrating from 2002. Since the .PGP file has been removed, how do you change command names for typing purposes?
Aug 3, 2008
Reply
i whant a list of auto cad commands
plz send me of 2 de auto cad
thanks
best regards
Rizwan Ali
Aug 3, 2008
Reply
i dont have knowledge about transparent hatch how can i make transparent hatch in Auto Cad 2008.
Aug 25, 2008
Reply
change short keyof layer isolate
Sep 15, 2008
Reply
i whant a list of auto cad commands
plz send me
thanks
Nov 14, 2008
Reply
Hello Sir/Mem,
Can you send me List of using short cammond of AutoCad by Key bord, Let me also
I can do programing in this s/w wiought any use from out side,
Jan 10, 2009
Reply
sir m just the biggner,i want learn autocad so please help me get started…
Jan 19, 2009
Reply
My system (computer) restart when i click on the layer isolate icon plas help me?
Jan 19, 2009
Reply
i want knw more about attribute dialoge box
Apr 10, 2009
Reply
hi,
sir i want to ask a simple introduction of autocad, and the basic command used for bechlar of engineering
May 17, 2009
Reply
please help me some one : how to make layer mode in auto cad.thnx
Mizan Al Rahamn Ali /Bangladesh
May 18, 2009
Reply
Hello Mizan,
This article is not belong to LAYER subject. Please see our articles about LAYER (http://www.dailyautocad.com/autocad/new-e-book-layers/). I’m sure you can define your problem more clearly after reading this e-book. Please keep on reading.
Thanks
Jun 22, 2009
Reply
good day,
im finding what is command alises for?
im a student in com.tech..
some one help me please