AutoCAD

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

7 Jul, 2006 By: Bill Kramer

Discover which layers are set for plotting with this month’s top tip.


Great News for Harry Tipsters!Hot Tip Harry Challenge 2006, sponsored by Autodesk, just got better with even bigger prizes. You already know that the author of each published tip will receive a Cadalyst t-shirt, and the author of each month's best tip will receive $100 cash. Now, authors of all tips published in 2006 also will be entered into two year-end drawings. One lucky winner will receive a copy of AutoCAD 2007, courtesy of Autodesk, and a second winner will receive a trip to Autodesk University 2006 in Las Vegas, Nevada. For contest details and rules or to submit your tip, go to www.cadalyst.com/harry2006.

GET THE CODE
Download code for this and all articles. Look for JUL06.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.

For More AutoCAD Tips More Often: Check out Cadalyst's free Tips & Tools Weekly e-newsletter. View the archives and subscribe today!

Harry turned in a large volume of programs for this month. He mumbled that a lot is going on out there and something about double-wide characters in ObjectARX driving him nuts. So let's dig into this month's interesting entries.

Ever wanted to know how long an entity is or how long a group of entities are? If so, then Entity Length (Tip #2127) by Julio Monge is just for you. When loaded into AutoCAD, the LISP code supplied in this tip creates a new command named GRLEN. Type GRLEN at the Command line and then select lines, polylines, splines and circles. When you are finished with the selection, a dialog box appears containing the total length of the objects selected. Great job, Julio -- an elegant solution that demonstrates the power of the object system.

In the Potentially Extremely Useful category is Attribute Filter (Tip #2128) from Raymond Rizkallah. After loading the LISP code, type TT to start the new command. The program will ask you to pick an attribute from which the routine will extract all the information needed from the selection and drawing. After running, the previous selection set contains all the insertions found in the drawing containing the same attribute tag. This is extremely useful when using drawings that contain variable attribute sets -- thanks, Raymond, for a fine programming job.

Viewport Lock and Unlock (Tip #2129) from frequent contributor Theodorus Winata is used to lock up viewports quickly. When a viewport is not locked, it is not difficult to change the model view by accident. Theodorus's solution is to lock them all (or unlock them all) at once with this handy LISP function. Use this function by typing LV at the Command line after loading in the LISP code. This program is short due to the power of Visual LISP objects -- a great example for those learning to use these tools.

M. Newman from Ireland supplied the next two tips. Polyline Property Copy (Tip #2130) is a utility to take the basic properties of one polyline and transfer them to a different polyline. The basic properties include the layer, elevation, color and so forth. Once loaded, the command name to activate the property copy is POLYPROP. This utility is wonderful for cleaning up drawings created to standards only imagined in the mind some user. Along those same lines is Remove Empty Strings (Tip #2131). The empty strings result from users backspacing out text (and mtext) objects instead of deleting the text objects. Once loaded into AutoCAD, NULLTEXT will hunt down and remove all the empty text and mtext objects in the drawing. A tip of the hat from Harry for some great LISP solutions to overcome those odd things users can do when left on their own too long without proper training.

Wall Filler (Tip #2132) from Jay Thomas consists of five different functions that draw different types of wall fillers. After the loading LISP code into AutoCAD, type PO1 through PO5 to run the filler routines. Each routine does a slightly different type of fill with PO1 being the most basic and PO5 the most complex. If you draw floor plans, these utilities are for you. You can adjust them to match your preferred scales and styles. Thanks, Jay, these are great productivity tools!

Another tool for drawing floor plans is Room Area Dimensions (Tip #2133) by Rich Pellicane. With the LISP code loaded, type SQRD to start the dimensioning tool. The first tool will allow you to trace the corners of a room and then place the area annotation for that room into the drawing. Once you have created a room area annotation, the option exists to do an entire floor by locating the corners of a rectangular area. Repeated use of the SQRD macro allows you to quickly annotate the room areas of a floor plan and demonstrates a nicely structured program style.

No Plotting Layers List (Tip #2134) by Brock Narum presents a quick display of the layers that will not plot in the current drawing. Load the LISP code and type NOPLOTLAYERS for a list of layers (presented in an alert dialog box) that will not plot. If all layers are currently set for plotting, a message will display in the alert dialog box indicating that status. A very nice demonstration of how to get at the layer data in a drawing using Visual LISP along with a creative way to display the data to the operator. This is July's top tip -- congratulations, Brock!

Underlying Layer Query (Tip #2135) by Michael Kolomiyets allows you to take a look under the hood of nested objects to learn what the layer setting is. It also demonstrates how you can explore nested objects inside LISP with ease and is an excellent example of list manipulation for report generation purposes.

Thanks for sending in your tips! Harry is always looking for more. Just make sure you send the source code and not a compiled or encrypted file. The goal is that everyone gets great utilities and an opportunity to learn from example. Keep on programming!


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
At your company, who has the most say in CAD-related software purchasing?
CAD manager
CAD users
IT personnel
vice-president/department manager
CEO/company owner
Submit Vote