Hot Tip Harry: Tips from Our Readers -- December 2005
14 Dec, 2005 By: Bill Kramer CadalystGreat tips for annotations and external data files.
| |||
James Sturgess sent in a tip that can Draw a Bracket Character Using a Polyline (Tip #2075). The bracket "{" can be facing left, right, up or down. Load the AutoLISP program and type BRACKET to start the function. Locate the two ends of the bracket and direction you want the nub to point. This is a nice way to insert a bracket into a drawing instead of placing a single character with a greatly enlarged font. Thanks James!
Craig Klein provided the time saving Attribute Entity Object Edit (Tip #2076). This handy utility changes the layer of an attribute object to match the layer of a previously selected object, which saves the hassle of looking up the layer of a particular object and then running the Attedt command. Everything is automated under the hood. Load the LISP program file and type MAT at the Command line to start the layer match utility. Simple and sweet, just as Harry likes it!
In-Line Mtext (Tip #2077), sent in by Leland Leahy, lines up a second set of Mtext with a previously selected Mtext object. It lines up the Mtext neatly, just the sort of thing needed for manipulating multiple Mtext objects comprising a report or bill of materials. Load the LISP program file and then type FMT at the AutoCAD Command line to activate the function. Individually select two Mtext objects. The first one selected is the control object. The second one will line up underneath. Leland used entity lists to manipulate the data for the Mtext, making this tip an elegant example of that style of programming.
From the United Kingdom came Chris Latham's Editing Blocks (Tip #2078). Load the LISP code and type EB to start the process. EB asks for you to select a block insert and a point where you want to place the exploded copy of the block. The exploded block is inserted at that location, and you can make changes to the original graphics using the standard AutoCAD package. When the edits are complete, type EB again and then select the new block contents. The code will reconstruct the block and regenerate at all prior insert points. Lots of fun to play with and handy if you have annoying blocks such as the type that inspired Chris to write the tool. Thanks for sharing!
Tommy Teague sent us two macros that make up General Notes (Tip #2079). General notes are those specifications that repeat from project to project. Teague created two functions to assist in creating those parts of a drawing set. The first function is used after a drawing is completed. If the drawing contains notes you want to save for future projects, load the LISP file for EXPORTNOTES.LSP and type ExportNotes at the AutoCAD Command line. You will see a prompt to locate text objects to save. General notes normally have a key notation, and this function expects to find strings so formatted. Key notations are a letter or number combination used to quickly designate a particular item in the plan set. To use the exported text file in a different drawing, load the LISP file and type ImportNotes. When asked, select a file and then locate where to start the notes. This tip is a very powerful set of functions that does a lot more than I can describe quickly. The source code is worth a look for those wanting to learn about text manipulations. The download file set contains two function source files (LSP) and three text files for demonstration purposes.
Our last tip of the month came in from previous tipster Jeff Sanders. This tip is something that many have pursued since the dawn of AutoLISP: Read a File Containing Coordinate Data and Plot Points (Tip #2080). This tip is not an ordinary point import routine. It's not written for a specific file type and format; Jeff's utility will work with ASCII text as well as Excel files. You can use data in different formats as well. For LISP programmers this tip is a powerful example of manipulating Excel data as well as a nice template to adapt to your own data requirements. A tip of the hat to Jeff for a quality tip!
2005 Wrap Up
Final selection is underway for the 2005 Best of Harry winner. Each month readers vote for the most popular tips and then Harry selects the best of the best from that winning group.
New for Next Year
January will mark the launch of our new and improved Hot Tip Harry Top Tip contest. Each month, I will select a top tip, and its author will earn a $100 prize. Authors of all published tips will be entered into the end-of-year grand prize drawing for some excellent prizes.
To help you with your programming, Cadalyst is also launching the Hot Tip Harry forum which I will moderate at www.cadalyst.com (select Discussion Forums). The forum will feature an area to seek programming help and another for those looking for particular routines. Be sure to check it out!
Happy Holidays and best wishes for a prosperous new year!
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!