[Search tip detail and code files using keywords, tip number, author name, etc ]
Custom Commands: Lock Osnapz and Xref Button
Tip# 3533 By Michael Chilson On 15-Nov-2010
Rated By 1 users
Categories : Toolbars
Software type : AutoCAD 2011
Rename File To : No Files to download.
Use button macros to more easily access the tools you regularly use.

Tipster Michael Chilson submitted some command macros that he uses to reduce the number of clicks in his daily routine.

"Lock the Osnapz feature in AutoCAD with a toggle button. This feature allows you to snap your selection points to a UCS (user coordinate system) z-axis height. For example, you can set your UCS to 0,0,10. All dimension nodes and dimension lines will snap to this 10' plane. This can be set by a custom button placed on a toolbar. Here is the code to copy into the Macro Location for the new command:
osnapz $M=$(-,1,$(getvar,osnapz))
"For those who still like the classic look of the toolbars to get access to the tools they regularly use, this adds an External References button to the Quick Access toolbar. To start this process, you will need to modify and create a new Quick Access toolbar called External References. I used the same icon as the external reference link under the View Tool Palettes location. In the macro location of that toolbar, paste the following code:

"This creates a toggle button, like the Properties and Design Center quick-access buttons. All of these tips help to reduce to the number of clicks currently needed to get to these commands. These do require the knowledge of how to create new commands and toolbars.

"Icons can really be anything. Remember that AutoCAD will need a 32 x 32 bit image and a 16 x 16 bit image; use your favorite image-editing software to reduce them down to that size. The images should be placed in a working folder (usually the icon folder located on a local hard drive). These can be incorporated into an enterprise CUI file to ease office-wide distribution."

Notes from Cadalyst Tip Patrol: With these button macros, Michael makes it easier to get to the tools he regularly uses. Making commands for toolbars, palettes, or the quick-access toolbar all follow the same procedure: Make a new command in the CUI (command user interface), then put that command in the place you want it displayed. These macros read the value of current settings in AutoCAD, then change them. This allows them to act like a toggle switch: just click the button to turn the setting on or off.


Average Rating:

User comments

Log In