Hot Tip Harry: Tips from Our Readers -- July 20066 Jul, 2006 By: Bill Kramer
Discover which layers are set for plotting with this monthâ€™s top tip.
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!