Back

Move Over, Mouse… My Keyboard Had a Tune-Up

In  the Beginning

As a longtime CAD user I frequently find myself typing in shortcuts to access commands. Don’t get me wrong, I love the ribbon and its functionality in AutoCAD®, but there are times when I just want to type a quick set of keys to access my more frequent commands. Many long-time users edit the acad.pgp file (AutoCAD programmable parameters file) with a text editor for our favorite key combinations then copy from version to version. These same users continue to use acad.pgp file and edit that file for two or three letter keyboard shortcuts.  Here’s a quick review of how to edit the acad.pgp file via a text file and the aliasedit express tools command.

To edit the acad.pgp via a text file, follow these instructions from Autodesk Help.

1.  At the Command prompt, enter ai_editcustfile and press Enter. Then enter acad.pgp (AutoCAD) or acadlt.pgp (AutoCAD LT), and press Enter as shown in Figure 1.

Figure 1: Edit the acad.pgp

Note: The default pgp file can also be opened by launching Windows Explorer or File Explorer, and navigating to your user folder and then double-clicking the Application Data or AppData folder. Continue to navigate to Roaming\Autodesk\<product name>\<release>\<language>\Support. Double-click acad.pgp (or acadlt.pgp for AutoCAD LT) to edit the file. If prompted for an application to use, select Notepad.

2.  In the text editor, add your new command aliases to the bottom of the file. Save the pgp file after you make the desired edits.

Figure 2: Add commands via text editor

3.  In AutoCAD or the AutoCAD-based product, at the Command prompt, enter reinit and press Enter.
4.  In the re-initialization dialog box, click pgp file. Click OK.
5.  Test your new command alias and edit the pgp file as needed.

Autodesk recognized this was a frequently used technique and came up with an Express Tool named Aliasedit making it easy to create shortcuts and edit the acad.pgp file by following dialog boxes and steps. This command can be found on the Express tools tab of the ribbon under the tools panel named Command Aliases. You can create and/or add a shortcut to the acad.pgp in four simple steps as illustrated in Figure 3.

1.  On the Express Tools tab on the ribbon.
2.  Select Command Alias as shown.
3.  Select the Add box as shown.
4.  Type an alias (I recommend 2 or 3 letters max).
5.  Add the command to AutoCAD and it will be immediately available via the command line.

Note: if the command alias you select is already used, you will be notified if you want to override the existing alias. Many long-time users modify commands to suit their needs.

Figure 3: Express Tool Aliasedit

Maximize your Key Combination

What about the CTRL, SHIFT, ALT and the function keys? You cannot use Aliasedit to alter these keys; therefore, you have to use the CUI (customize user interface) and create and/or modify a keyboard shortcut. I am referring to a different kind of keyboard shortcut—the one that does not refer to a letters but special key combinations on your keyboard. Keyboard shortcuts differ from command aliases whereas in a command alias you have to hit Enter after the shortcut has been typed in. With a keyboard shortcut you type the sequence of keys and the command is launched immediately.

The CUI and Shortcuts

You can add/modify keyboard shortcut commands in AutoCAD by using the CUI. To access the CUI, go to Manage tab or the ribbon and navigate to the Tools panel, then select the CUI button as shown in Figure 4.

Figure 4: The CUI

To set up a keyboard shortcut, search in the command window for the command from which you want to create a shortcut. Once you have found what you are looking for, in this case ATTIPEDIT, highlight that command and drag from the Command List area to the Shortcut Keys node as shown in Figure 5. This will not affect any of the command functionality as it currently exists within the program.

Figure 5: Drag the shortcut

After the command has been placed under the Shortcut Key node you will see the properties of that command listed in the lower right corner of the CUI editor. In Figure 6 we list four areas of the CUI we will review.

1.  The Command List area: Where to find any command within AutoCAD that you would like to apply a shortcut.
2.  The Shortcut Keys area: New command dragged into the keyboard shortcut notes.
3.  The Current Shortcuts.
4.  Access section where keys will be assigned.

Figure 6: CUI areas

When you click on the Key(s) window (Figure 6, Section 4) you will see the ellipses (…). Click on the ellipses to open up the keyboard shortcut dialog box as shown in Figure 7. This is where you will assign the key combination you will use.

Figure 7: Shortcut Keys window

When assigning keyboard shortcuts, you do not type in the letters as you would with a command alias. Within the blank window area, you type in the sequence of keys that you wish to apply the command and the combination will appear. If the shortcut is already assigned you will see a note that this shortcut is currently assigned to another command as shown in Figure 8. If you have other programs that already have shortcuts assigned no commands will be displayed and a shortcut for that sequence is unavailable.

Figure 8: Strike the keys

Type in a shortcut that has no pre-assigned value and issue the command as shown in Figure 6.

Figure 9: Assign the command and review the results

Hit Apply – OK to leave the CUI editor and use your CTRL+G keyboard combination to test out your new command. As you begin to assign shortcuts you can use the Shortcuts Section in the CUI as shown in Figure 8 to list all of the current shortcuts available in AutoCAD. From this window you can view any of the keyboard shortcuts that are assigned to a command. A file of all your keyboard shortcuts can be printed and placed near your desk.

Figure 10: The current shortcut list

After adding all of the commands and your keyboard shortcuts exit the CUI and those shortcuts will be available immediately in your drawing session. You can assign keyboard shortcuts to any command listed within the CUI.

Functioning with OSnap Overrides

We've just seen how to create custom keyboard shortcuts by using the CUI, so now let's take it one step further by reconfiguring your keyboard's function keys to use as Object Snap overrides.

You are probably thinking, "Why?” 

Well, think about how you traditionally use Object Snaps.  You can either use Object Snaps (aka OSnaps) as "Running OSnaps," where you have one or more OSnaps constantly turned on (hence, "running"), but AutoCAD will always be looking for a way to snap to something every time the cursor hovers over an object which can affect AutoCAD's performance.  Also, with two or more OSnaps constantly running, you can inadvertently select the "wrong" OSnap by accident (e.g., you might select a "MIDpoint" when trying to select an "INTersection"), which will cause errors in your designs. 

The other method is to use "OSnap Overrides" where you only activate the OSnap on an as-needed basis where you hold down the shift key on your keyboard, right-click your mouse button, and then select the desired OSnap from the pop-up menu. For many people, that can seem like a lot of clicks, especially if you are doing it over and over again.  You could also have OSnap toolbars present on your screen and simply click the icon, but toolbars to some people cause clutter and take up valuable screen space.  And there may be some really “old school” guys who still type in their OSnaps (e.g., “MID” for “Midpoint”).

But now you're thinking, "Won't I lose the default commands assigned to my function keys?”

Yes.  But the beauty is that every function key command is also available at the bottom of your screen for quick access already.

So now we come back to customizing the keyboard to turn your function keys into OSnap overrides.

Just as in the previous example (Figure 6), we will enter the command CUI to launch the interface window to drag a command into the keyboard shortcuts area, and then assign a function key using the four steps as shown in Figure 11.

1.  Once the CUI appears on your screen, scroll down in the "Command List" pane and select an Object Snap command (e.g., "Snap, Center").
2.  Click and drag the desired OSnap command in the pane above into the "Shortcut Keys" tree under "Keyboard Shortcuts."
3.  Click on the OSnap command you just dragged, and in the "Properties" pane expand the "Access" tree and click on "Key(s)", and then click the ellipses button with the three dots.
4.  When the "Shortcut Keys" window appears, click inside the field and press the desired function key on your keyboard to assign the OSnap.  (Note: Make sure your Caps lock is OFF before assigning the key; otherwise, to initiate the OSnap you will have to press "Shift+Function Key.”)

Figure 11: Adding Snap, Center to a function key

Once you have assigned your desired function keys, you can click the "OK" button to exit the CUI Manager.

On a personal note, following is a list of the most common OSnap commands that I have assigned to my function keys, but you are free to assign them however you wish.

F1 = Default Help
F2 = Default Command History
F3 = OSnap, CENter
F4 = OSnap, PERpendicular
F5 = OSnap, INSert
F6 = OSnap, ENDpoint
F7 = OSnap, MIDpoint
F8 = OSap, INTersection
F9 = OSnap, QUAdrant
F10 = OSnap, NEArest
F11 = OSnap, M2P
F12 = OSnap, APPINT

Please note: I strongly suggest that function keys "F1" and "F2" be left alone so that you can quickly access "Help" and the "Command History" as normal.

Figure 12: Leave F1 and F2 with the default settings

Conclusion

A keyboard shortcut is one more way you can make AutoCAD work for you. Customize the program to your needs and how you work and alter within the different types of work you do. You can even create custom commands using macros, add those commands to the CUI, and finally assign a keyboard shortcut. How cool is that? Keep moving forward and give your keyboard a tune-up and assign shortcuts to make your system run better and more efficiently.

Appears in these Categories

Back