Our Friends: Leaflet Printing , Presented by: Talia Cad Software

Sign In

Subscribe

Subscribe to Daily Autocad.


May 30
Wednesday
Autocad, Hints & Tips, Programming
Command 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
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
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: , , ,

Viewed 10,663 times so far... This week: 96 Today: 18 Latest: 3 July 2009, 23:34

Post Tags:

18 Responses to “ Command aliases in AutoCAD ”
  1. 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.

  2. 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))

  3. Christopher Tomkins

    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

  4. Muyiwa Odumosu

    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.

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

  6. 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?

  7. i whant a list of auto cad commands
    plz send me of 2 de auto cad
    thanks
    best regards

    Rizwan Ali

  8. abdul waheed khan

    Aug 3, 2008
    Reply

    i dont have knowledge about transparent hatch how can i make transparent hatch in Auto Cad 2008.

  9. change short keyof layer isolate

  10. MUHAMMAD ALI

    Sep 15, 2008
    Reply

    i whant a list of auto cad commands
    plz send me
    thanks

  11. 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,

  12. sir m just the biggner,i want learn autocad so please help me get started…

  13. My system (computer) restart when i click on the layer isolate icon plas help me?

  14. i want knw more about attribute dialoge box

  15. hi,
    sir i  want to ask a simple introduction of autocad, and the basic command used for bechlar of  engineering

  16. Mizan Al Rahamn Ali /Bangladesh

    May 17, 2009
    Reply

    please help me some one : how to make layer mode in auto cad.thnx

    Mizan Al Rahamn Ali /Bangladesh

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

  18. good day,
    im finding what is command alises for?
    im a student in com.tech..
    some one help me please


Post a Comment



All content and source © 2008 Daily Autocad | News Plus wordpress theme brought to you by Zidalgo.