While nearly all AutoCAD functions are easily accessible by mouse, a lot of people prefer using keyboard commands as they find them quicker. Unfortunately most keyboard commands are quite long and / or not that memorable. You can however create shortcuts for commands like AS for Add Selected, SS for Select Similar or any other command you use frequently. We will be discussing two different ways of making custom commands. Use whichever you find more convenient for you.
Add command aliases in ACAD.PGP / ACADLT.PGP* file
*acadlt.pgp is for AutoCAD LT versions
1. Go to the Manage tab in ribbon.
2. In the Customization section, select Edit Aliases or use command “AI_EDITCUSTFILE”, write “acad.pgp” / “acadlt.pgp” and press enter
3. This should open up your acad.pgp / acadlt.pgp file in a text editor which by default in most cases is Notepad:
4. Scroll down the text editor and you’ll see a complete list of existing command aliases. All the ones you see are those set by default and most are very useful and will help speed things up. So before you go about making custom command aliases, browse the list and you may find what you need already exists.
It is highly recommended you do not make any changes to this default list. Doing so will make upgrading to newer versions of AutoCAD very problematic.
5. Instead scroll down to User Defined Command Aliases section and here you can create new aliases of your choice. If a command alias appears twice in this file then the one in the User Defined section takes precedence over the other. Which means any alias you enter for any command will override the default set alias.
6. To add a new command simply enter the command alias in a new line followed by a [,], space(s) and then [*] and the command name. See image below:
7. To confirm changes, save your acad.pgp file and close it.
8. You will need to restart AutoCAD before the changes take effect or you can use “REINT” command to reload acad.pgp / acadlt.pgp without restarting AutoCAD.
Alternatively, if you’ve had express tools installed you can use the tool Command Alias Editor to directly make changes to the acad.pgp / acadlt.pgp file without having to open it.
1. Go to Express Tools ribbon and then select Command Aliases. See image below:
This’ll open a window where you can edit or add command aliases:
2. Scroll the list and search for the command you want an alias for. If the command isn’t listed look for the alias you wish to make.
3. If neither is listed then select Add. This will open up a new window:
4. Here type in the alias of your choice. Scroll the list to find the command you want or type it in the box. Typing part of the name will automatically reduce the list for you, allowing you to choose the command.
5. Your new command will now be a part of the original list once you press OK:
You can also use the Edit button to change an existing command in the same way but this is not recommended due to the upgrade issues mentioned earlier.
6. Once you hit Apply the changes will be saved. You may have to restart AutoCAD before changes take effect or you can use “REINT” command to reload acad.pgp without restarting AutoCAD.
7. Now that your new commands are ready, go ahead and try them out in the command line.
Create command using AutoCAD CUI (AutoCAD Custom User Interface)
“Customized User Interface” dialogue box can be opened by three methods:
- Type CUI at the command line window
- In the Ribbon go to Manage and then User Interface
- In the Quick Access toolbar click on the Customize Option
1. Once CUI editor is displayed. Right click on the command list and select “New command”:
2. This will open another window ‘Customize User Interface’:
3. In the properties pane, the first line is the command. You can give it a memorable name here. This is the title which will be used whenever you want to apply this command.
4. Add a simple description for future reference.
5. Now go to the “Macro” Box. A Macro is a list of instructions for AutoCAD to follow. It is basically the information required for the customised command to execute. Here you are telling the CUI what your new command will do. Macros are entered in the Macro Text Box like a simple command line or script. In cases where the command is very large the Long String Editor can be used.
Creating a new Macro is a bit tricky. Let’s see how to create awesome macros.
A good practice is to start your macros with “^C^C” which is equivalent to hitting the escape key twice. This makes absolutely sure that you are out of any commands and it only desired command will be executed. Following “^C^C” is the new command. For example “^C^C Line” will eliminate any previous commands and then execute the Line Command. Some characters have specific meanings:
|Space||Adds space between text objects|
|; (Semi Colon)||Equivalent to pressing enter|
|\||Pauses for user input|
|+||Continues the Macro to the next line|
By using these characters and pre-defined existing commands you can create your own customized commands.
At the bottom of properties pane there is an option to add an image. You can choose to add an icon for your command.
Now you can put those commands to good use. You can drag them to your dashboard, to a menu, to a toolbar or even to a key in your keyboard. Go to the Command List Categories drop-down list. In custom commands option, look for your customized command by name. Select it and drag it anywhere in this customized interface.
Click Ok and try your new Command.
This is going to save a lot of your time and also help to minimize errors.
The first option is pretty straightforward. I edited the .pgp file, saved it, and it worked perfectly. But it seems the second method it’s even simpler! This article was a lifesaver, thank you.
[…] pour en savoir plus sur les alias de commande dans Autocad, reportez-vous à ce post (en […]
Hi!, I´ve made a custom command (a _qleader that previously sets a specific layer), added to my toolbar without problems, works like a charm, but I´m having a rough time binding it to a keyboard shortcut (alias in the .pgp file) when I type the corresponding alias (“RRR”) the custom icon and the command display name are correctly shown, but it doesn’t work after pressing enter. Any ideas what am I doing wrong?
I’m not sure how to fix the issue you are having without changing the method of how you’re doing it. In my experience, I’ve come across commands that do not have aliases and were only accessible through the ribbon/toolbar such as arc: start, end, radius. The internet was basically no help. I was able to figure out that there’s a list of shortcut keys in the CUI menu that can be added upon. Find your command by searching for it in the bottom left of CUI. Then drag and drop in your command into the shortcut keys folder. It will then appear in the top right menu. If it didn’t auto bring up that menu, you can click on the shortcut keys folder and it will appear. Find your command in the list and change it’s shortcut to something that starts with ctrl, shift, or alt I believe. Not only is this an amazing workaround for adding non aliased commands, but these commands do not go through the command line. They act as instant commands. If you are in the copy command and enter PL for poly line, you’re not going to enter the polyline command. But if polyline was bound to ctrl + shift + 7, you will instantly leave the copy command and enter the polyline command. I would highly recommend switching over your most used commands there and get a macro board to streamline your drafting. Also, make sure that whatever you bind things to doesn’t already exist as a computer function (i.e. ctrl + V). I hope this helps.
[…] Image source: CAD Notes […]
Excellent article. One point I’d add to make things even easier. When making up custom commands, being right handed (my mouse hand) I’ve put most of my short cuts on the left hand side of the key board. Using AutoCAD Architecture, my WALLADD command is “1”, and not “WA since WINDOWADD could also be “WA” it is “2”. To keep things consistent DOORADD is “3”. It takes a little getting used to and a cheat sheet helps till it becomes automatic. Cheers