CAD from the Streets (Hot Tip Harry AutoCAD Tutorial)

29 Feb, 2008 By: Bill Kramer

This month's winner simplifies pipe and column drawings by automating AutoCAD's Extrusion command.

Download code for this and all articles. Look for MAR08.EXE or MAR08.ZIP in Get the Code. Downloads are free and are provided "as is" without warranty or support.
Tips are tested using AutoCAD 2008, 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.
Important note: Be sure your submission contains all elements required for it to run independently in AutoCAD. Tips that are missing functions or other necessary elements will not be considered.
Join the Hot Tip Harry Hot Code Contest
Calling all tip writers! The Hot Tip Harry Hot Code Contest is under way for 2008.
Share your hot tips and tricks and you could win an official Cadalyst t-shirt, $100 monthly cash prize, and a chance to win a trip to Autodesk University 2008 in Las Vegas!
E-mail those tips and tricks to
For More AutoCAD Tips More Often: Check out Cadalyst's free Tips & Tools Weekly e-newsletter. View the archives and subscribe today!
Harry's Code Class Free E-Newsletter:
Learn from the master himself. "Hot Tip Harry" author Bill Kramer offers monthly lessons in customization programming for AutoCAD. View the archives and subscribe today!
He's constantly on the prowl, and Hot Tip Harry seeks your input on how to make your AutoCAD experience better. These tips come from the street, folks just like you using CAD every day to make the world a better place. If you have a tip or trick to share, send it to Harry via e-mail and check out the Get the Code! library of past tips. And now for this month's new tips:

Tip 2272: Layer Color Change
Ryan Wunderlich sent in Layer Color Change, a marvelously simple but useful tool for changing layer colors. To use this tip, load the LISP code into AutoCAD and type XCC. You will be prompted to select an entity. After you have selected an entity object in the drawing, the Color dialog box will display with the current color assignment of the entity object layer. Picking a new color will cause the layer color assignment to be modified. Wunderbar, Ryan! This utility is much quicker than navigating the Layer command to change the colors.

Tip 2273: Change Circle Diameters
Change Circle Diameters from Antonia Acosta is a handy tool for structural detailers who need to change large bolt-hole diameters. Load the LISP code and type CH_CC at the AutoCAD Command line to activate this tip. You will be asked to select circles in your drawing. The utility activates a filter so you can select only circle objects when using Windows, streamlining the pick process. After you have selected several circles, you will be asked to type in a new diameter value. All the circles selected will be changed to the input diameter. This tool is great for power edit when you have to make a lot of edits. Thanks, Antonia!

Tip 2274: Steel Plate Extrusion
Also from Antonia Acosta, the Steel Plate Extrusion utility is a handy LISP program that allows you to sketch steel plates in 2D and then quickly extrude them into 3D. After drawing steel plates as closed polylines, load the LISP code and type 3DFLG at the Command line. You will be asked to supply the plate size and to select the plates for conversion. The rest is automatic, making this a handy utility for drawing 3D extrusions quickly.

Tip 2275: Align Text
Align Text from Ramesh Gopal lets you align text vertically or horizontally. Load the LISP code and type TAlign. Select the text objects you want to align. Next, the utility will ask you to select a control text object. The other objects selected will be aligned using the base point of the selected control object. Next, type V or H for vertical or horizontal alignment. The rest is automatic with this power-editing tool. Harry says excellent work, Ramesh!

Tip 2276: Brick Hatch Generator
Brick Hatch Generator is a great tip from Raymond Rizkallah. Rizkallah put his imagination and programming skills to work in creating this program that makes brick hatch patterns. Load the LISP program, type BRK at the Command line, answer a few simple questions about the brick size, and the program launches into the BHatch command with your freshly created brick pattern as the default pattern. The input you supply to define the pattern includes the file name, brick length, heights, joint size, and whether or not to overlap the bricks. Great tip, Raymond. And there's more where that came from.

Top TipTip 2277: Pipe and Column Extrusion
Raymond Rizkallah also supplied this month's top tip, Pipe and Column Extrusion, a set of utilities for 3D drawing work. The functions - CV3, CV4, and CV5 - simplify the creation of pipes and columns by automating AutoCAD's Extrusion command based on an entity object selection. All three, contained in the same source code file, accept a 3D line as input and then create a 3D solid shape. Use CV3 to generate a cylindrical column, use CV4 to create a square column, and use CV5 to create a column out of a closed x,y-plane polyline defined inside a block. These functions compute the required planes, then run the AutoCAD commands, allowing you to quickly transform lines into extruded cylinders, rectangles, and other shapes. Great work, Raymond, and a tip of the hat from Harry as he slides out the door to seek more tips from the power users on the CAD streets.

Until next month, keep on programmin'.

Join the Hot Tip Harry Challenge
Harry needs your tips! Do you have an original routine written in VBA, Visual LISP, or even ObjectARX for AutoCAD customization? Send it in, with all the source code, to Your tip may be needed by others now, so don't delay!

Subscribe to Harry's Code Class
Cadalyst's Hot Tip Harry helps programmers and programmer wannabes learn the ins and outs of AutoCAD customization in his monthly e-newsletter, Harry's Code Class. Subscribe to Harry's Code Class today and start building your programming expertise.

Hot Tip Harry Discussion Forums
Harry is standing by online to aid AutoCAD users and programmers. Cadalyst's Hot Tip Harry -- Help! Discussion Forum offers assistance with AutoCAD programming and customization problems. Hot Tip Harry -- Requests Discussion Forum can help you locate a specific LISP or VBA routine for AutoCAD. Participation in Cadalyst Discussion Forums requires registration, but it's free.

Get Your Weekly Fix of AutoCAD Tips
Cadalyst's Tips & Tools Weekly e-newsletter mails each Monday, delivering AutoCAD tips by readers for readers -- all reviewed by Cadalyst's volunteer Tip Patrol. Plus, you'll receive a rundown of new online CAD resources, deals and freebies, new CAD-related hardware and software products, and more. View the Cadalyst Tips & Tools Weekly archives and subscribe today!

AutoCAD Users: Check out Cadalyst Tips & Tricks Tuesdays
All it takes is a minute or two, and you could be off to more productive use of AutoCAD. Cadalyst announces Tips & Tricks Tuesdays with worldwide AutoCAD Technical Evangelist Lynn Allen. Each Tuesday, Lynn and Cadalyst bring a new, super-quick tip to the Cadalyst Video Gallery. Subscribe to Tips & Tricks Tuesdays and receive an e-mail notification every time a new tip goes live in the Cadalyst Video Gallery.

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!