Hot Tip Harry13 Mar, 2004 By: Bill Kramer
Cut and paste, a new chainlink fence, and more.
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.
HATCH PATTERN ELEGANCE
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!
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.
*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
VISUAL LISP FOR DIMENSIONS
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!
In her easy-to-follow, friendly style, long-time Cadalyst contributing editor Lynn Allen guides you through a new feature or time-saving trick in every episode of her popular AutoCAD Video Tips. Subscribe to the free Cadalyst Video Picks newsletter, and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!