cadalyst
AutoCAD

Tip or Treat? (Hot Tip Harry AutoCAD Tutorial)

30 Sep, 2008 By: Bill Kramer

This month's goodies include a utility to annotate profile data.


GET THE CODE
Download code for this month's tips at Cadalyst's CAD Tips site. Search for the tip of your choice by tip number or keyword. 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 harry@cadalyst.com.
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!
Trick or treat? Harry was in a good mood. From the briefcase tucked neatly under his coat, he produced a laptop full of tricks and treats ready for download from Cadalyst's new and powerful CAD Tips site. (Just use the tip numbers below for the fastest way to search for a tip!) His grin grew into a big smile as he talked about this month's really neat selection-set manipulations and expert drawing tools.

Tip 3012: Maintain Selection Sets to Copy
Ronald Maneja sent in an interesting set of functions that allow you to maintain multiple selection sets ready to copy. In Maintain Selection Sets to Copy, the command functions Q1, Q2, and Q3 operate like the Copy command. The first time you run one of the Q functions, you are asked to define a selection set of entity picks to be used in a Copy command. The next time you run the same Q function, the previous selection set is automatically selected for the Copy command. To clear the set, type RQ1, RQ2, or RQ3 respectively. This routine uses the global symbols SS1, SS2, and SS3 to house the selection sets and PTS1, PTS2, and PTS3 for the points, meaning they could interfere with existing programs in your system. Harry recommends that you change these common symbol names to something more cryptic, then have at it.

Tip 3013: Manipulate a Selection Set
In his second tip of the month, Manipulate a Selection Set, Maneja demonstrates how to manipulate a selection set by creating a temporary red box around the limits of the combined entities. Load the LISP code and type BBS to try it out. After you specify the selection set, a red box will highlight the limits of the entities selected. Programmers will find this tip a handy example to learn from when investigating how to manipulate a selection set and how to find the limits of the set so the screen can be adjusted. The screen adjustment may be needed if your application will be adjusting the entities using AutoCAD edit commands inside LISP code. Thanks to the Wizman — and a tip of the hat from Harry!

Tip 3014: Fix Pointing Leaders
Fix Pointing Leaders from Phil Tingley provides a set of tools to ease the work of fixing leaders pointing at holes that have been moved. Two command functions are included in the tip: FL (fix leader) and EL (edit leader). After loading the LISP code, type FL at the AutoCAD Command prompt to move the tip of the leader to point at a hole or endpoint. Use EL to add another vertex into the leader string. These hardcore productivity tools are from a shop where the drawing process keeps changing. Sound like your place?

Tip 3015: Calculate Excavation Area Volume
Theodorus Winata sent in Calculate Excavation Area Volume. This tip determines the volume of closed excavation areas using a depth you supply, then annotates the drawing with the calculated information. Two sample drawings are included. Load either the metric or Imperial drawing and the VOL.LSP file. Type Vol at the AutoCAD Command line and follow along in the dialog box to create the text annotations. Another expert system from a software genius!

Tip 3016: Subdivide Lot into Desired Areas
Subdivide Lot into Desired Areas from Noel Gemilga divides a subdivision lot into the specific areas you desire, equal or unequal. This tip continues the theme of an expert drawing system by automating tedious work. Take a look at the included JPEG image for a better understanding of this tool. Start with a simple lot layout, and this routine will divide it into equal areas following a generally horizontal route through the area. When you've defined a basic lot, draw an Xline through it, then load the LISP code. Type AS at the AutoCAD Command line to activate the utility and follow the prompts. Although not useful for everyone, this code is nicely done and illustrates how LISP can solve problems of this nature.

Tip 3017: Annotate Profile Data
Top TipPedro Ferreira submitted this month's top tip, Annotate Profile Data, which is an expert annotation system for profile data. A sample drawing shows how this system works and how you can adapt it to your own requirements. Open the drawing and load the LISP code that comes with it. Type AP to get it started and answer a couple of prompts with information from the drawing. The rest is automatic. This example employs the Visual LISP enhancements and is a wonderful productivity tool for civil engineers.

What great tips! Keep sending them in and be sure to check out the improved CAD Tips site. Thanks for reading and until next time, 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 harry@cadalyst.com. 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!