Hot Tip Harry

12 Mar, 2004 By: Bill Kramer

Cut and paste, a new chainlink fence, and more.

Download the code for this and all Cadalyst articles. Look for file mar04.exe in Get the Code.

Tips included in Hot Tip Harry are tested with AutoCAD 2002 and 2004, 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 downloaded or copied for commercial purposes. Tips are uploaded to the Get the Code area. Look for a file named mar04.exe. Downloads are free, but you need to register. Downloads are provided “as is” without warranty or support. 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 2004. The first prize is $1,000. Second place wins $500, and third place, $250. E-mail those tips and tricks to

THE COLD AIR IN THE OFFICE GOT a bit warmer when a package arrived from the tropics. Inside were pages of paper with text clipped from newspapers and magazines.

It seems that Harry found a new cut-and-paste toy. Ramesh Gopal's Tip #1931 includes a LISP function called (C:TBOX). The Tbox command draws a rectangle around text that you select in the drawing. This well- written routine demonstrates how easy it is to manipulate point data obtained from entity lists and the (textbox) subroutine of Visual LISP. I was pleased to note the use of (mapcar) skillfully intertwined in the code. Thumbs up!

The next set of routines were text cut-and-paste utilities from Len Nemirovsky. Tip #1932 houses a command function named (C:SWAP) that lets you swap the contents of one text object with the contents of another. Len's Swap utility makes manipulating tables and notes in drawings a lot easier. It also demonstrates how to manipulate text entity objects in Visual LISP. Load the LSP file and type Swap to activate.

Len's second contribution, BRG.LSP (Tip #1933), helps you place bearing and distance annotations in a drawing. Select a line object, and the macro prompts you to supply the points to attach a callout that shows the bearing and distance of the line you just selected. This is a dandy tool for surveyors and map designers. Len used the DIMSCALE factor to determine how large to make the text. Harry added a comment next to that in the code in case you want to change the value.

There is something to be said for elegance, and Watson Kilbourne delivers. His pattern for chain-link fencing shows that even good things can be improved. Check out Tip #1934 and the simple five-line pattern he provided to draw a chain-link crosshatch. Simple, elegant, genius!

*CHAINLNX, Chain-link fencing
90,  .1,.3, .6,.4, .1,-1.1
90,  .2,.3, .6,.4, .1,-1.1
45,  .1,.4, -2.6870057685,.141421356, .70710678,-2.68700577
135, .2,.4,  2.6870057685,.141421356, .70710678,-2.68700577
This works best in an enclosed area. Download the tip and place the PAT file in your support path folder. Next use Bhatch and select the options for a custom pattern. Look for the chain-link fencing option in the custom patterns that are available.

Now for some sweet Visual LISP coding from Phil Tingley, along with a demonstration of how to manipulate the dimension object. Tip #1935 is designed to make it easier to manipulate the precision of a group of dimensions instead of changing the properties one at a time. A menu file and bit-maps for the icons are provided to simplify its operation, or you can simply load the LSP program file and run it from the keyboard by typing Dimdec.

Phil Tingley's second routine was originally included in the tip for dimension object manipulation, but I decided it was too good to be a tagalong. The Lineup command (Tip #1936) lets you define a line along which the text for the dimension objects is placed. Select the dimension objects, and they line up. Neatness counts for a lot.

Next, Ken Kaiser offers a document file that describes how to use the MNU system to create your own custom viewport-to-scale selections (Tip #1937). It includes complete instructions on how to add the custom menu to your existing menu. This is a useful example if you are just learning about menus and equally useful if you need a quick way to set viewport scales in paper space.

Tip #1938 includes two functions from Stacey Conrad that streamline scaling. The first sets the scaling factor with the (C:SSS) function, and the second runs the Scale command with the preset scale factor using the (C:SSC) function.

Until next time, keep on programming and sending those tips to Hot Tip Harry!

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!