Technology Industry
Industry: Email Alert RSS FeedTips from our readers: control your layers, date your drawings, and more
CADalyst, August, 2004 by Bill Kramer
As I walked out of a cafe in Athens, Greece, I noticed the sun shining brightly off a little car. Who was leaning against it? Harry, of course. "Ever seen one of these?," he asked. "Little sucker gets 100 kilometers to the liter." I wasn't sure how he fit into it, let alone the ton of tips he carries around with him. I didn't have to ask what Harry was doing in Athens. There on the car seat was an envelope marked Olympics. Harry said, "That's for your readers--some great stuff once again."
LAYER CONTROL
Most RecentTechnology Articles
- The Google Manifesto: Dr. Open and Mr. Closed
- RIM Is Getting Too Successful for Its Customers' Good
- Tech Law: Google Loses in France, GPL Suits Target Many, IBM Sued, More
- Microsoft Moves Fast, Already Has Custom XML Patch for Word
- Microsoft Might Get Advantage or Pain from Order To Not Sell Word
- More »
First event up in the Tip Olympics is layer control. Everyone has a better way of doing layers. That's what makes them great--they're so adaptable. Of course, that means you need to be able to track them. That brings us to Get Object Color Relationship (Tip #1968) from Walt Bedinger. This utility lets you check the color and layer relationship for entity objects. After loading the function, type Getcolor at the Command prompt and select an object in the drawing. A prompt appears with the object's color and layer assignments. This is a friendly function that lets you know if a color assignment is by block, layer, or the object. It also clearly demonstrates how the color code and layer name system are used in entity data lists.
Theodorus Winata's Copy to Layer (Tip #1969) lets you select a layer name from a dialog box. After you pick the layer name, an object selection prompt appears for objects to be copied. You can select multiple objects. Next the routine requests a base point plus displacement point. It copies the selected objects to the new location with the layers changed. Combining multiple steps into a single command is what it's all about. Excellent tip!
The leader in complexity for the layer events is Layer Display Suite (Tip #1970) from Rechen Nan. This suite of commands is supplied as a pair of files zipped together. Unzip the files and place the LSP and DCL files in the standard AutoCAD search path. Once the LSP file is loaded, you can select from six commands that control the display of layers (by hiding or showing them). The commands in this suite are:
* Ho: hide selected objects
* Show: show all objects
* Hexp: hide all objects except those selected
* Sbl: show objects on layers selected
* Hbl: hide layer based on object selection
* HBLE: hide all objects except those on layers of selected objects
How useful is a function set like this? That depends how many layers you have.
SIMPLE WINS THE PRIZE
As you know, an elegant and simple combination of commands to accomplish a task is often best. Date Stamp (Tip #1971) from Leonid Nemirovsky is a great example of this concept. The date stamp program (type DST after loading the LSP file) asks for a location, then inserts the current drawing name, along with the date and time the drawing was last saved. This routine takes advantage of the field feature in text inside AutoCAD 2005, resulting in a short and succinct function. It won't work with earlier releases of AutoCAD.
Quick Area (Tip #1972) from Bryan Bobrick provides a quick answer to the question: What is the area of that object? After the LSP file is loaded, start the Quickarea command. The function prompts you to select a closed object such as a circle or a polyline. After you select the object, the routine executes the Area command and shows the value in the AREA system variable. Quickarea displays the value from the system as square feet and other units of measure, although you may be using different units. This function is a great example of how to exploit information inside AutoCAD with AutoLISP.
Watson Kilbourne supplies us with another hatch pattern, Arched Tiles (Tip #1973). This hatch pattern looks like a tiled roof. Watson's genius for patterns knows no parallel. This one makes you want to start tiling every roof.
THE COUNTDOWN BEGINS!
Harry reminded me that we're in the closing stretch for the $1,000 grand prize in our own Code Olympics. Some readers have contributed great code so far, but it's not over yet. Visit the Cadalyst Web site (www.cadalyst.com) and send us your best work to review for inclusion in Hot Tip Harry's library.
GET THE CODE Download free code for this and all articles at www.cadalyst.com. Look for aug04.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. Find out more online, and e-mail your tips and tricks to harry@cadalyst.com. Vote for your favorite tip this month at: www.cadalyst.com
Bill Kramer, president of AUTO-CODE MECHANICAL,
contributing editor for Cadalyst, former headmaster of the Wizard's Lab at pointA, and refugee scribe from Cadence, is a programmer and writer with more than 20 years of experience in the field of CAD/CAM/CAE.
CXO UnpluggedSmart Business interviews on BNET
Brought to you by CBS MoneyWatch.com
- Best- and Worst-Paid College Degrees
- 6 Things You Should Never Do on Twitter or Facebook
- How Much Sleep Do You Really Need?
- 6 Big Myths about Gas Mileage
- 5 Rules for Immediate Annuities
- Death in the Family: 12 Things to Do Now
- Dumbest Things You Do With Your Money
- 6 Online Networking Mistakes to Avoid
- 401(k) Mistakes to Avoid
- 5 Economic Scenarios to Keep You Up at Night
- The Real ‘Best Places to Retire’
- Best Credit Cards for You
- 12 Tough Questions to Ask Your Parents
- The Real ‘Best Colleges’
- Home Buyer Tax Credit: How to Cash In
- Why You Shouldn't Bash Cash
- 8 Phony 'Bargains' and Better Alternatives
- Danger: 3 Debit Card Scams to Avoid
- 6 Myths About Gas Mileage
- 29 Fees We Hate Most
- Quick and Easy Ways to Boost Returns
- Best Stocks to Buy Now
- Lower Your Taxes: 10 Moves to Make Now
- New Jobs: 8 Lessons from Real-Life Career Switchers
- The New Job Market: Who Wins and Who Loses?
- Health Care Reform's Public Option: Everything You Need to Know
- Volunteer Work When Unemployed: Should You Work for Free?
- Whose Recovery Is This?
- Long-Term-Care Insurance: 4 Biggest Risks to Avoid
Content provided in partnership with
Most Recent Technology Articles
Most Recent Technology Publications
Most Popular Technology Articles
- BizRate to monitor in-store customer satisfaction for Office Depot stores - Market Intelligence
- Speed control of separately excited DC motor
- Effects of creative, educational drama activities on developing oral skills in primary school children
- Political stability and economic growth in Asia
- Failed businesses in Japan: a study of how different companies have failed, and tips on how to succeed, in the Japanese market



