manage those layers

30 Apr, 2003 By: Bill Fane

Captain LearnCurve was packing his scuba gear in preparation for his upcoming trip to the Dominican Republic with his beautiful wife. He carefully laid each component in his gear bag, building up layers so the more delicate equipment such as his regulator and camera would be padded and protected by his buoyancy compensator and wet suit. Suddenly, his acute hearing picked up the plaintive wail of a far-off AutoCAD user.

I have thirty drawings to plot. Each contains a dozen xrefs and more than two hundred layers. To plot them, I have to freeze some layers, change the color of some, and change the lineweight of others. The layer changes alone will take forever!

Fortunately, the Captain had a couple of hours to fill before his flight left, so he wrote this column about AutoCAD's layer management tools.

The layer management tools started life as an Express Tool and were later incorporated into standard AutoCAD, where they work with a slight difference that you must be careful of. This difference may be more of an issue now that the Express Tools are shipping standard with AutoCAD 2004. More on this later.

The easiest way to learn how the layer manager works and when to use it is to dive right in and give it a try.

In AutoCAD 2002 and earlier, open the file c:\program files\…\sample\1ST FLOOR.DWG. In AutoCAD 2004, open the file c:\program files\…\sample\8TH FLOOR.DWG. In either case, the \…\ folder name depends on whether you run standard AutoCAD or one of the vertical applications such as Mechanical Desktop or Architectural Desktop. It's a good idea to copy the samples to a working folder so you don't mess up the originals.

Both drawings feature several xrefs with many layers, so they are perfect for our purposes.

Start the Layer command, either by typing it at the Command prompt or by clicking the Layers button to the left of the layer name window. This summons the standard Layer Properties Manager dialog box (figure 1).

Figure 1. The Layer Properties Manager dialog box provides Save State and Restore State buttons at top right.

I stretched the dialog box size a bit so I could better show its contents and labels. You've most likely seen and used this dialog box before before, so I won't bore you with the basics.

Two buttons are of particular interest. Click on the Save State button near the upper right corner of the dialog box. This conjures up

Figure 2. Create new layer states with the Save Layer States dialog box.
the Save Layer States dialog box. Make sure all the buttons are turned on, and then type the word Default in the New Layer State Name window. The dialog box should look like figure 2.

Click OK in the Save Layer States dialog box to return to the Layer Properties Manager dialog box.

Now we're ready to start playing. In the Layer Properties Manager dialog box, start changing things at random. Freeze a few layers, change the color of others, change several lineweights, and so on. Click OK to return to the drawing and observe your changes.

Do a bit of editing in the drawing, then return to the Layer Properties Manager dialog box.

Now, put everything back the way it was.

Hold it! Won't that be a lot of work?

Figure 3. Layer States Manager dialog box features import and export options so you can apply saved states to other drawings.
Not if you do it the easy way. Click on the Restore State button in the Layer Properties Manager dialog box. This brings up the Layer States Manager dialog box (figure 3).

There's only one saved state so far-Default from a few moments ago. With it highlighted, click Restore in the upper-right corner of the dialog box. Presto, change-o! The Layer Properties Manager dialog box instantly changes all settings back to how they were.

Sometimes I need to flip back and forth between the Default layer settings and my revised ones.

No problem. Use the Layer Properties Manager dialog box to change the settings to the way you want them. For example, let's freeze all Lighting layers. Here's a trick. Click on the first Lighting layer. Now move down to the last Lighting layer, but press and hold before clicking on it. All the intervening layers are selected. You can also use -mouse click to add single layers to the selection.

Once you select a group of layers, go to the Freeze column and click any one of the sunshine symbols within the highlighted collection of layers. All layers in the set change to show a snowflake to indicate they are frozen.

Now click on the Save State button. Type No Lighting in the New Layer State Name window, then click OK. The Layer Properties Manager dialog box returns.

Now click on the Restore States button. The Layer States Manager dialog box (figure 3) now contains two names: Default and No Lighting. Double-click either name, and the Layer States Manager dialog box disappears. The Layer Properties Manager dialog box now shows the settings that you associated with the selected name. You can repeat this as often as you want, flipping back and forth between saved layer state names.

Now let's go back to the Save Layer States dialog box in figure 2. Obviously, you don't need to save all the details that define a layer. You can save any combination of the options that are shown. For example, you may want to save and restore the frozen vs. thawed state and on vs. off state, without regard for color or lineweight changes.

By now, you should begin to see some uses for this feature.

Architectural applications are probably the most common use for the Layer States Manager. A tall building might be designed as a series of drawings, one per floor. Within each drawing, you create separate layers for walls, plumbing, wiring, ventilation, and so on. A master drawing then brings all the xrefs together so you can check everything for fit.

Now it's time to plot the drawings. You can plot many different variants from the same master drawing. For example, you might want to plot the walls for the third floor in a thin gray halftone, the ventilation system with black heavy lines, and everything else frozen. Saved layer states make it very easy to flip back and forth from floor to floor and discipline to discipline as required.

AutoCAD saves named layer state sets with the drawing, so they are available in any later editing session.

Cool, but I have twenty different drawings to plot, and each one needs the same combination of layer properties.

Not a problem. The Layer States Manager dialog box (figure 3) has buttons that let you export to and import from a file. You can easily transfer named layer state settings to other drawings.

I mentioned earlier that there's an Express Tool layer manager as well as the built-in one. They look and work almost exactly the same, except the data storage methods and export/import file formats for named layer settings are different and not compatible. It's possible but messy to transfer from one format to the other.

The Layer States Manager dialog box has an Edit button, but all it does is turn off the layer states and layer properties selection (figure 2). Although you can select buttons to turn them on, it doesn't retroactively update the defined layer set. Similarly, if you turn a property off, then back on, you lose the original data.

You can't add or delete layer names or change the layer settings within a named set. All you can do is redefine it using the same name.

One final warning is that all of this works properly only when you religiously adhere to the principle that object properties should be set by the layer on which they reside. If you override object color, linetype, or lineweight independently of its layer, you'll get unexpected results when you edit the layer properties and state. This is good advice even if you don't use the Layer Manager.

Despite these gnarly bits, the Layer States Manager is a powerful, useful tool for manipulating combinations of layer settings.

If you go scuba diving in Florida, make sure you go on a Friday with Captain Slade on Key Largo. He has befriended some of the locals. It is an interesting experience to sit on the sea bottom as you cradle a 7' shark in your arms.

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!