[Search tip detail and code files using keywords, tip number, author name, etc ]
Use AutoLISP Shortcut Commands
Tip# 4305 By Levi Connolly On 19-May-2014
Rated By 0 users
Categories : Programming Examples
Software type : AutoCAD 2014
Rename File To : No Files to download.
If you like to use keyboard shortcuts, take a look at these AutoLISP commands that can save you some time.

Levi Connolly shares this time-saving AutoCAD tip.

I execute most of my AutoCAD commands from the keyboard. Even though there are buttons that do most of these macros, I get the job done with a few keystrokes and a slap on the space bar. A good drafter, in my opinion, will have one hand at the keyboard and one at the mouse for 90% of the time. Below are some macro routines I use regularly.

lv unlocks all viewports in a layout:
     (defun c:lv()(command mview l on all )(PRINC))

ulv unlocks all viewports in a layout:
    (defun c:ulv()(command mview l off all )(PRINC))
woo turns wipe out frames on:
    (defun c:woo()(command wipeout f on)(PRINC))
wof turns wipeout frames off:
    (defun c:wof()(command wipeout f off)(PRINC))
iff turns image frames off:
    (defun c:iff()(command IMAGEFRAME 0 )(PRINC))
ifo turns image frames on:
    (defun c:ifo()(command IMAGEFRAME 1 )(PRINC))

Notes from Cadalyst tip reviewer R.K. McSwain: Levi likes to use keyboard shortcuts, as do a lot of people. If you are in this crowd, take a look at the AutoLISP shortcuts Levi includes with this tip. Even if you don’t need these particular commands, you’ll probably find some inspiration to shorten something that you do use frequently. A recent tip is similar to the locking/unlocking viewport commands here, except the other one lets you (or makes you, depending on your point of view) select the viewports.


Average Rating:

User comments
Comment by Maeding,James
Posted on 2014-05-19 13:38:11
Our company has about 150 of these as standard issue, way too many to remember. So in the key-in definition, we include a message saying what the tool does: (defun c:MM ()(princ "draws an m and m...")(command....)) what you can then do is write a function that searches your key-ins for keywords, and lists them. Our function is PK for Print Key-ins. You type PK, then a word, and it lists the items with that word in the c: part or princ statement following. I'll submit this idea as a tip and see if cadalyst uses it.
Comment by Aubin,Marcel
Posted on 2014-05-19 15:32:52
« A good drafter, in my opinion, will have one hand at the keyboard and one at the mouse for 90% of the time. » I totally agree.... Being a computer consultant specializing in AutoCAD, I deal mostly with drafters and I have noticed that effectively, the most productive drafters do have a hand on the keyboard and the other on the mouse. Lot's of them even turn the ribbon off to get more drafting space.
Comment by Biswas,Abhijit
Posted on 2014-05-30 23:14:45
About Levi's "A good drafter ... one hand at the keyboard and one at the mouse ..." - I agree wholly. I minimise the ribbon & hide/autohide whatever I can to get maximum screen-space. I guess it comes from having started with DOS. All my common commands have 2-letter aliases in acad.pgp, except a few where the responses are also automated via 2-3 letter AutoLisp macros. Also, since I never use the Grid on/off command via F7 key, I have configured F7 to "zoom dynamic". These have sunk into my AutoCAD mind, so that I use them without thinking and believe it enhances my productivity with AutoCAD greatly. Incidentally, this approach has carried over to all other regular tools ... Windows, Excel, Word, OutLook, SolidWorks. Mousing menus & ribbons (instead of keyboard-shortcuts) feels like being handicapped. Of course, it does leave me rather helpless on computers other than my laptop!