Tips From Our Readers

14 Jul, 2004 By: Bill Kramer

Draw rigid insulation, line up text, measure areas, and more.

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

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 with a top prize of $1,000. Find out more online, and e-mail your tips and tricks to

HARRY SHOWED UP A FEW minutes late to our meeting. "I've got a variety of great stuff, some from repeat submitters," he said as we settled into the sleazy diner (he always seems to like those places).

First up was a tip from the Pattern Man, Watson Kilbourne. "He's at it again," Harry said. "This guy is amazing." This month, Watson sent another of his elegant hatch pattern descriptions-this one for roofing shingles (Shingle Hatch, Tip #1961). Copy the PAT file into AutoCAD's support directory and select it inside the Bhatch command as a custom pattern.

Another familiar name was next on the list. Theodorus Winata submitted a utility that makes life easy when drawing rigid insulation along a line or arc. Rigid Insulation (Tip #1962) is an AutoLISP function that lets you select a graphic object for insulation hashes to follow. After you load the LSP file, type RAL at the Command line to start the command.

It asks you to select an arc, a line, or a polyline. Then choose or type the size and the side where the hatches should appear. This tip demonstrates the power of blending parameter and entity data with commands to create powerful tools.

Tommy Teague supplied a great example of combined parameter input with repeated AutoCAD commands in his Cut Window (Tip#1963) utility. This handy function lets you cut and trim objects inside a closed boundary by repeating the Trim command. Load the LSP file and type in CA or Cleararea to activate the command. Select a series of boundary objects and an inside point-the rest is automatic.

This clever routine leverages the AutoCAD commands inside AutoLISP and lets you open up a window for placing other graphics or text. Note that objects you want to trim out of the enclosed area must be the kind that can be trimmed.

Text Spacing (Tip#1964) from Tracey Richmond lets you quickly move text objects so that they line up in a neat paragraph. After loading the LSP file, type TS to start the command. The first text string you select is the top of the paragraph. Each text string you select after that is placed below the first. It's important to make drawings neat, and this tool makes that task easy when working with sporadically placed text objects.

Autodesk Architectural Desktop users should take a look at AEC Extract Automation (Tip #1965) from Dina Jacobson. This utility automates the schedules extraction process for a project. This nice, well-written routine shows the use of extensions in AutoCAD that relate to Architectural Desktop. This is also worth looking at as an example of good error processing.

Harry was reluctant to show the next tip. "This one is dangerous-I wasn't sure if you'd want to see it." Sure enough, he was right. I knew this guy, a parentheses slinger out of the South with a thick accent and a love for surf and turf. Master programmer Will DeLoach supplies us with a way to access a plot object inside AutoCAD. Plot Object Select (Tip#1966) contains a set of AutoLISP functions and a dialog box definition. As with all DCL files, place it in a directory that AutoCAD automatically searches.

Load the function set and type the command Change_page_setups. A dialog box appears in which you can select from the different plotter setups. This is an advanced function set that demonstrates how to access AutoCAD's application object and plot object system from inside Visual LISP. Very nice, Will. Your work is inspiring-as in the next tip.

Dean Langmaid saw an earlier tip from Will for measuring line distances and wondered if it could be adapted to measure the area property instead. Sure enough, his curiosity paid off. Object Areas (Tip#1967) calculates land use, so the output values are in acres. You can adjust that to match you own requirements.

Harry appreciates all code submissions. Are there any VBA or ARX tips out there you'd like to share? Remember to add comments and use meaningful variable names when possible. Other people will be reading the tips submitted to Harry, so keep it neat and clean.

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!