AutoCAD

Hot Tip Harry: Tips from Our Readers -- February 2006

3 Feb, 2006 By: Bill Kramer Cadalyst

Great LISP calculators, plus drawing archival preparations and much more.


GET THE CODE
Download code for this and all articles. Look for FEB06.exe in Get the Code. Downloads are free and are provided "as is" without warranty or support.

Tips are tested using AutoCAD 2006, unless otherwise noted. By submitting code to Cadalyst, you grant Cadalyst the right to print and distribute your code in print, digitally and by other means. Cadalyst and individual authors retain all rights to the code, and it is not to be used for commercial purposes.

Important note: Be sure your submission contains all elements required for it to run independently using AutoCAD 2006. Tips that are missing functions or other necessary elements will not be considered.

All published tips earn the author a Cadalyst
t-shirt, and the tip judged best each month earns the author $100. Click here for details about the Hot Tip Harry Challenge 2006.

E-mail those tips and tricks to harry@cadalyst.com.

The word on the street is that people are using calculators of their own design more often inside AutoCAD. This month Harry slips us a series of tips where LISP is used to deduce the results of equations -- some easy, some not so easy. But first the winning tip of the month is a useful tool for power AutoCAD users.

Drawing Archival Preparations (Tip #2087), from Craig Goings, is this month's top tip. Written in VBA to allow multiple drawing manipulations, this routine will load a drawing and then rebind external objects to a local folder for easy archiving. In the download file set for this tip, a read file from Craig explains the operations in much more detail, and he points out where VBA hackers might want to change a few things to match their own archiving requirements. Great job, Craig, and thanks for sharing this power tip with everyone!

Charles Allred's Dimensions Manipulations (Tip #2088) makes dimension editing a snap. Load the LSP file into AutoCAD and type DIMSWEEP at the Command line to activate the utility. DIMSWEEP presents three choices: Replace, Restore and Remove. Replace changes the dimension value to a text string, allowing you to move the dimension components without changing the data displayed. Restore is then used to change the text back into an associated value, and Remove gets rid of the text altogether. Edits to dimensions are much easier with this great example.

Tipster Paul Hinds sent in two useful tips. Block Name Replacement (Tip #2089) and Modified Array Command (Tip #2090) are examples of how easy it is to customize AutoCAD to your needs. In #2089 you load the LSP file and type REPLACE at the Command line. Select the block inserts you want to change, type in the new block name to use (which you should have already defined in the drawing), and this routine takes care of the work. Harry noted that this tool is helpful when you need to update a lot of block occurrences in a drawing with a new library of figures. Tip #2090 is a modified version of the AutoCAD Array command for making multiple copies of objects in a rectangular pattern. After the LISP code is loaded, type MARRAY to run. Instead of having to know the distances between objects, MARRAY uses two end points and a count of how many spaces you want between the end points. Simple yet effective is the name of the game in LISP customization, and Paul's nailed it.

Now the calculation utilities Harry dropped off. These utilities are generally pretty short, and you can use them in a variety of ways. You might modify the reporting utilities to retrieve a value you need, use them as is or build them into command macros. The first utility is Compute Arc Values (Tip #2091) from Derek Beals, which computes one of the values of an arc given the others. This program runs as you load the LSP file and displays the results of the calculations in an alert box. Calculations include arc length given included angle and radius, included angle given radius and arc length, and radius given arc length and included angle. You don't find these calculations on many calculators even though they are pretty simple.

Thomas Christman supplied Scale Calculator (Tip #2092) for quickly calculating a scale factor or ratio for a detail area in a drawing. It will also calculate the dimension linear scale factor for the scaled detail area. Two functions are in this tip, DSCALE and DFACTR. After loading the LSP file into AutoCAD, type DSCALE if you know the drawing scale factor and scale factor of the details (e.g.: 2X is simply 2). The resulting scale ratio (1:n) is presented along with the required setting for the linear scale factor when dimensioning. DFACTR computes the scale factor given the detail ratio if those are the values known.

Fibonacci Sequence Polynomial Factor Computation (Tip #2093) came from Robert Gillies. Rather than explain the Fibonacci sequence and how you can use it in computer simulations along with other analyses, let me just say that this tip is an elegant solution that employs several clever mathematical tips. If you need a Fibonacci generator, then get your hands on this tip!

Our last tip of the month comes from Mike Lavelle. Distance Command (Tip #2094) is an improved distance command for AutoCAD. Load the LSP file and type D at the AutoCAD Command prompt. After you supply two points, the function presents the distance between the two along with vector, angular and alternative units. This distance command goes the distance!

Thanks for the great tips everyone! Keep them coming in, and visit Harry's new online forums where you can suggest ideas for tip creators and discuss tips with other users.


About the Author: Bill Kramer


AutoCAD Tips!

Lynn Allen

Autodesk Technical Evangelist Lynn Allen guides you through a different AutoCAD feature in every edition of her popular "Circles and Lines" tutorial series. For even more AutoCAD how-to, check out Lynn's quick tips in the Cadalyst Video Gallery. Subscribe to Cadalyst's free Tips & Tools Weekly e-newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!
Follow Lynn on Twitter Follow Lynn on Twitter



Poll
Which file format do you use most often for CAD drawing/model exchange?
Native format
PDF
3D PDF
DWF
STEP or IGES
JT
IFC
Other
Submit Vote