cadalyst
AutoCAD

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

14 Jul, 2005 By: Bill Kramer Cadalyst

A hot tip for AutoCAD 2006 customization, plus tips for multi-line text, drawing rebar, reactor-based text fill, callouts with incremental numbering and more.


GET THE CODE
Download code for this and all articles. Look for JUL05.exe in Get the Code. Downloads are free and are provided "as is" without warranty or support.

Tips are tested with AutoCAD 2005, 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.

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 harry@cadalyst.com.

This month Harry's readers did some spring cleaning. Many of these tips have worked in AutoCAD for years, and the tipsters found them, dusted them off and sent them for all to enjoy. Harry also received some new tips, plus a hot one regarding AutoCAD 2006 customization. So let's get right to them!

Multi-line Text
Phil Clark sent a Multi-line Text Utility (Tip #2040) that allows the operator to select justification based on rectangle point selection. The first point selected becomes the justification corner for the MText object. Load the LISP code into AutoCAD, and then type MTJ at the command line to activate the utility. You will be asked to select the corner points of the MText insertion area. Pick the upper right corner of the MText area first to have the text justified to the right and top. This tip is a very intuitive approach to the multiple line text object in AutoCAD.

Drawing Rebar
Leonid Nemirovsky provided another utility for all to use called Draw Rebar Figure (Tip #2041). Here's a routine that works in early versions of AutoCAD as well as the most recent. A rebar (reinforcing bar) is a piece of steel placed inside concrete to provide additional structural strength. The placement of rebar is typically shown from the end of the bars with each bar represented as a solid circle. Len's utility provides an easy way to draw small, medium and large rebar solids. Load the LISP code into AutoCAD and type BAR at the command line. Next select the size desired, and locate the center point of the rebar. The program does the rest.

Reactor-Based Text Fill
Another repeater to Harry's tips, Andrzej Gumula, reveals some awesome magic with his tip called Reactor-Based Text Fill Mode Monitor (Tip #2042). AutoCAD operators dream about controlling the plot function, and this utility reveals the basics of how to do it. In this case the job at hand is to make sure the Text Fill mode is on when plotting. By using a reactor attached to the AutoCAD command object, the program checks to see if the Plot command was started. When a plot operation is initiated, the reactor forces Text Fill to a value of 1. This tip is a well-written gem that discloses how easy it is to modify the plot command system in AutoCAD. One note of caution for those wanting to do more: Reactors need to be programmed with uttermost care. The Visual LISP documentation clearly spells out some things to be wary of when authoring reactor functions.

Callouts with Automatic Incrementing Numbers
Heather Randles sent her well-established utility Drawing Callout Figures with Automatic Incrementing Numbers (Tip #2043). This simple function automates the drawing of callout bubbles in AutoCAD. Callout bubbles are leaders with circled text. The text contains a number that is referenced in a table describing the object or providing a part number reference. Load the LSP file into AutoCAD and type CALL at the command line. Each callout bubble contains an arrow point (located at the first point requested) and a line to a bubble (the second point requested is the end of the line). The bubble is created to the left if the second point located is to the left of the first and vice versa. The first time you run the CALL routine, the starting number is requested. From that point forward the number is automatically incremented by one. This routine is very useful and simple for drawings requiring callouts to further details or other sheets in a plan. Thanks for dusting this one off and sending it along, Heather!

Duplicating Layer Settings in Multiple View Ports (Tip #2044) from Paul Li copies the layer settings of a selected view port in paper space to one or more other views. If you create drawings that use multiple view ports, one problem that sometimes occurs is the coordination of layers between all of them. This tip copies the layer settings of a selected view port in paper space to one or more other views. Load the LSP file and type VPLMATCH at the AutoCAD command line. From a paper space window, select the source view port. The layer information is copied, and if there are frozen layers, the function will ask you to select other view ports to copy the layer settings. This is the fast way to handle multiple view ports!

Jeff Foster's Drawing Lines Pointing to Block Inserts (Tip #2045) will draw a series of lines (or ghost lines) from a designated point to all occurrences of a given block insert. When you are working with a large number of block inserts or for annotation purposes, the PT2BLK.LSP utility is sweet. The block of interest is selected by name or by picking an insert occurrence on the screen. Ghost lines are lines that stay on the screen only until the next regeneration of the graphics (Regen, Redraw or Zoom). This function will draw ghost lines or real lines based on your direction. Load the LSP file then type PT2BLK at the command line. A series of prompts will direct you through the utility. A nice job and very useful!

For those venturing deep into AutoCAD 2006 blocks, Harry received a tip from AUGI LISP guru Peter Jamtgaard, Dynamic Blocks (Tip #2046). Soon after the initial release a question came up in the Visual LISP discussion groups regarding the use of dynamic blocks in AutoCAD, and the challenge was issued to find the original name of the block programmatically. Peter answered the call by sending a LISP module that will ferret out the data given the entity name of a dynamic block occurrence. This tip is not for the beginner, but it is very useful for anyone programming AutoCAD who needs the original block name given the result of a dynamic block.

Thanks, everyone! Keep the tips rolling in.


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!