Hot Tip Harry: Tips from our Readers -- September 2005

14 Sep, 2005 By: Bill Kramer Cadalyst

Handy reader tips on rotating objects, creating selection sets, breaking lines, creating invisible objects and archiving

Download code for this and all articles. Look for SEP05.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 are entered into the annual Hot Tip Harry Contest. From a pool of reader-selected monthly winners, our judges will pick the Top Tip for 2005. The first prize is $1,000. Second place wins $500 and third place, $250. E-mail those tips and tricks to

As the summer months cool, Hot Tip Harry's best tip contest for 2005 is heating up with some excellent entries for your consideration. Be sure to vote for your favorites each month using the link provided. If you have not submitted your best tip, now is the time. Harry's column only has room for a few each month! So let's get right to them.

Rotating Objects
Two tips on rotating objects arrived this month. In the first, the goal is to rotate sketched lines so they become orthographic lines. Jim Himes sent Orthographic Lines (Tip #2054), which snaps a line to one of the 90-degree quadrants with the base point for rotation being one of the existing end points. Load the LSP file, then type OL at the AutoCAD Command line. Select the lines to be rotated (use Windows to select a large group), and when selections are finished, each line will highlight one at a time with an opportunity to select the end point for the rotation edit. This utility lets you quickly sketch an outline of something and then fix it up, a real time-saver for quick sketch artists!

Lee Thompson sent Flipping Lines (Tip #2055). This utility is absolutely required when drawing lines that use a line style containing embedded text, such as a gas line drawn in different directions (figure 1). If you wanted to always show the word GAS oriented toward the bottom of the drawing sheet, then it must be rotated 180 degrees. The MIRRORLINE LISP utility runs the Rotate command after loading the LSP code and typing the command name MIRRORLINE. Select the midpoint of the line to flip and the Rotate command takes it from there. Quick and easy gets the job done.

Figure 1. Lines with embedded text.

Creating a Selection Set
Sal Brusco shows us how to Chain Objects into a Selection Set (Tip #2056). Sal's utility function will create a selection set (that you can use in subsequent commands) based on connected end points. The utility will add lines and arcs sharing a common end point to the selection set so long as only one option exists. You can incorporate this utility into many application areas. To run the function, load the LISP code and type Chain at the Command prompt. Pick the starting line or arc at the end point farthest from where you want the chain to grow. In other words, pick the starting entity near the start of the chain. The chained objects will be highlighted and returned as a selection set as a result of the function. As a side effect, Chain sets the global symbol Chainset to the selection set for subsequent reference. Sal gets a tip of the hat for a job well done!

Line Breaks
Another utility from Lee Thompson is a simple example for Breaking Lines (Tip #2057). An overlapping line is broken with 3.5 drawing units on each side by simply picking the intersection point. The last object drawn at that intersection will be broken under the normal AutoCAD default selection rules. Why 3.5 drawing units? Lee said the value worked well with the 1/8-scale drawings he creates. You can easily adjust the distance setting in the source code to fit your needs. Load the function BREAK35, and type Brkline to run Lee's example. Then just pick the intersection point for the break to occur.

To See or Not to See
Previous tipster Andrzeg Gumula comes through with a way to pass secrets in your drawings. Turn Objects Invisible or Visible (Tip #2058) is a clever manipulation of the AutoCAD objects in Visual LISP. Load the LSP module and type INVIS to turn objects invisible. The objects are still in the drawing; they just have the visibility property set to off. Type VIS to make them all visible again. Now you can hide invisible messages in your drawings for future designers to find! Thanks again Andrzeg -- great utility and a wonderful example of good programming.

Creating Archives
Jim Dee's Archiving Utility (Tip #2059) creates a folder named Archive in each drawing folder. When you archive a drawing, the current state of the drawing is saved in the Archive folder using the drawing name plus the current time and date. You can retrieve the archived drawings at a later time for reference or to start a different part of the design from a template. This well-written utility demonstrates how to manipulate files in Visual LISP. To use, load the LSP code and type ArchiveDWG at the Command line. The rest is automatic.

Harry reports that he received several great tips that didn't pan out. Unfortunately, key elements needed to make them run were not included. If you submitted a tip recently and it has not shown up in the column, maybe something was missing (such as a standard utility function or drawing setting that you always have available). Submissions to Hot Tip Harry are tested using AutoCAD 2006 with no enhancement packages and the default standard profile.

Keep sending those great tips!

About the Author: Bill Kramer

More News and Resources from Cadalyst Partners

For Mold Designers! Cadalyst has an area of our site focused on technologies and resources specific to the mold design professional. Sponsored by Siemens NX.  Visit the Equipped Mold Designer here!

For Architects! Cadalyst has an area of our site focused on technologies and resources specific to the building design professional. Sponsored by HP.  Visit the Equipped Architect here!