Hot Tip Harry: Tips from our Readers -- September 200514 Sep, 2005 By: Bill Kramer Cadalyst
Handy reader tips on rotating objects, creating selection sets, breaking lines, creating invisible objects and archiving
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!
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.
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
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!