[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Drawing Utilities
Tip# 3664 By Nick Johnson On 12-Jun-2011
Rated By 1 users Downloaded : 937
Categories : LISP Code Modules, Programming Examples
Software type : AutoCAD 2012
Rename File To : Dwg_Utilities_2011.lsp
These short LISP functions are executed with keyboard commands.

If you are a keyboard junkie, you will probably like this tip. Nick Johnson has put together several short LISP functions that are executed with a short key-in command in AutoCAD. Examples include ZE for Zoom Extents, AU for Audit>Yes, and VL to lock all viewports. There are many others, including several to set the snap distance. The real beauty of these short commands is that they can be a stepping-stone for you to create your own shortcuts for anything you find yourself doing over and over. Thanks, Nick.


Average Rating:

User comments
Comment by Anderson,Jim
Posted on 2011-06-14 04:30:11
Thanks very much for sharing, the shortcuts are well presented for a bit of personal tweaking.
Comment by Karikomi,Edward
Posted on 2011-06-14 16:56:24
What is the advantage of a lisp routine vs. editing the alias list?
Comment by Kellogg,c. Frank
Posted on 2011-06-15 14:54:32
I use the acaddoc.lsp file to automatically load over 240 such keyboard shortcuts for every drawing. Most of them originated with a few lisp routines I picked up here at Cadalyst! Advantages: 1. Buttons move, but the keyboard does not change. The .lsp file can be very portable, and does not muck with the CUI (as in using custom buttons). 2. You do not have to move the pointer away from where you are working. 3. My primary reason is that the .pgp file does not allow command combinations, like Zoom | Extents. For instance, I have two commands "du" and "au" for switching several settings from decimal units to architectural units and back. see below for that code. 4. My other primary reason is that I HATE pull-down, slide over, go down again . . . menus. (maybe the Ribbon fixed that, but I'm stuck in acad 2004) I'll take a couple of keystrokes over menus any day. Here is the Units code: (defun C:du ( ) (command "units" "2" "6" "1" "5" "0" "n") (princ "Units Set To My Decimal Preferences" )(princ) ) (defun C:au ( ) (command "units" "4" "16" "1" "1" "0" "n") (princ "Units Set To Architectural Preferences" )(princ) ) You can't do that with the .pgp file! To see what all the settings need to be, do the command in the command line and record your selections. I hear there is a macro recorder in the newer acad versions, but that may only work for button creation. Thanks for sharing. Frank
Comment by McSwain,R.K.
Posted on 2011-08-26 14:00:25
Edward, also lisp code will overwrite PGP definitions. If your PGP defines a shortcut for "E", and you load some lisp code that also defines "E", the lisp code will win.