Improved Layering
Improved Layering
Improved Layering
GD401-3
AutoCAD 2008 introduces dramatic enhancements to Layers and Layer management. Join this
class for a practical overview of all these changes and how you can start putting them to good
use. You'll learn about all the improvements to the Layer dialog, Layer states, and various Layer
tools as well the new Layer Notification feature and the long-anticipated ability to apply Layer
property changes on a per-viewport basis. Learn how these tools work and when to use them
from one of the AutoCAD developers who implemented them.
Tom has been an Autodesk software developer for almost 10 years and currently works on the
AutoCAD Development Team. His AutoCAD experience spans more than 20 years and includes
production drafting, developing custom and commercial third-party AutoCAD add-on applications
and, of course, implementing new features for AutoCAD. Tom has worked on many aspects of
AutoCAD -- most recently, the new Layer enhancements introduced in AutoCAD 2008. He is a
frequent presenter at Autodesk University and enjoys the chance to interact with users.
tom.stoeckel@autodesk.com
SETBYLAYER
If youve ever tried to manage objects whose properties
(color, linetype, lineweight, plot style) have been set at the
object level, you know how frustrating it can be to get
control of them. If an objects property is set to anything
other than ByLayer, it displays that property regardless of
the layer on which it lives. Further, those objects will not
be able to display any viewport layer property overrides
that may have been assigned.
Using the new SETBYLAYER command, you can force specified properties of a selection set of objects
to ByLayer. Objects that have a ByBlock setting can also be changed to ByLayer. Unlike the CHPROP or
CHANGE commands, SETBYLAYER works on blocks & nested blocks and allows you to change all the
color, linetype, lineweight, material & plot style settings back to ByLayer in one shot instead of one at a
time.
Choosing Yes causes properties that are currently set to ByBlock to be changed to ByLayer.
Include blocks? [Yes/No] <Yes>: Y
Choosing Yes causes the properties of all blocks in the selection set (including the block definitions and
nested blocks) to be changed to ByLayer. Changed blocks and nested blocks remain intact and will not
be exploded. Blocks not included in the selection set will not be affected.
2 objects modified, 1365 objects did not need to be changed.
Once the operation is complete, a message will be displayed indicating how many objects were changed.
LAYISO updates
After adding the ability to fade locked layers, the Layer Isolate command (LAYISO) was updated to
leverage this new functionality. The old version of LAYISO simply turned off the layers not being isolated.
The new version of LAYISO now offers the option to lock and fade those layers instead.
Command: LAYISO
Current setting: Hide layers, Viewports=Off
Select objects on the layer(s) to be isolated or [Settings]: S
Enter setting for layers not isolated [Off/Lock and fade] <Off>: L
Enter fade value (0-90) <70>: 60
Select objects on the layer(s) to be isolated or [Settings]:
Initially, the color, linetype, lineweight and plot style properties in these columns will be the same as the
equivalent global properties. For example, both the Color and VP Color columns may show white as the
current value. Changing these properties is exactly the same as changing the global properties:
1. Highlight the layers you want to change
2. Pick on the property to be changed
3. Choose a new property from the dialog
The difference is that property changes made in these columns only apply to the current viewport.
Another way to assign layer property overrides is by
restoring saved layer states to a viewport. The Layer
States Manager now has an Apply properties as
viewport overrides restore option. Checking this
option before restoring a layer state causes the layer
properties being restored to be applied to the current
viewport as layer property override values.
This is an extremely quick way to set up the layer properties of a specific viewport with some confidence
that those properties wont accidentally change because of work youre doing elsewhere in the drawing.
Property overrides assigned to xref layers are not retained when the VISRETAIN system variable is
set to 0.
These layers are easily identifiable in the Layer Properties Manager when it is opened within a layout
viewport. You can see which layers have overrides using any of the following:
A background color displays for each layer name, override and corresponding global property setting.
Hovering your cursor over the name of a layer with overrides will display a tooltip containing both the
global and override property information for each property in that layer.
The Status column will display a different icon for layers with property overrides.
The layer combo box on both the Layers toolbar and the Layers dashboard
panel will display a background color behind layer names with property
overrides in the current viewport (this is the same background color used
inside the Layer Properties Manager). For color overrides, the override
color is displayed in the combo box instead of the global color.
The Properties toolbar will display ByLayer (VP) and a background color
for layers or objects that are assigned property overrides. Override
properties are displayed for color, linetype, and lineweight instead of global
properties.
The dashboard Object Properties panel will display a background color
behind the color, linetype, lineweight, and plot style controls. Override
properties are displayed for color, linetype, and lineweight instead of
global properties.
You can also use the new VPLAYEROVERRIDES system variable to check if the current viewport
contains layer property overrides. This is a read-only system variable that returns 1 if the current viewport
has associated layer property overrides and 2 if it does not. This is a quick way to check a viewport when
no other visual indicators are available or when you need to check it programmatically.
All property overrides from all layers in the drawing in either the current viewport or all viewports. This
works on all layers regardless of current selection in the layer list.
Another quick method is to select the borders of one or more viewports in a layout, right-click on a
border, and choose the Remove Viewport Overrides for All Layers option from the context menu.
This will remove overrides from all layers associated with the selected viewports.
Opening a drawing
Plotting a drawing
Attaching or reloading xrefs
Restoring a layer state
Using Templates
At this point you may be saying, Okay, this is cool but I use the same 200 layers in all my drawings! Do I
have to reconcile them every time I start a new drawing? Not necessarily. If your drawing templates
(.dwt) contain your standard sets of layers, you can reconcile the layers in each template. New drawings
started from those templates will begin life with all layers reconciled and an established baseline. The
best part is - you dont have to manually reconcile the layers in your templates. All you have to do is
resave them.
When saving a drawing as a template (.dwt) file, you are offered the
Template Options dialog to provide additional information about the
drawing template. This dialog now includes options to save all the
layers in the drawing as unreconciled or reconciled. By default, all layers
are saved as unreconciled so that new drawings start without a
baseline.
If you choose to save the template file with all layers as reconciled, a
layer baseline is automatically created. Now, new layers added
drawings started from that template are automatically unreconciled and
new layer notification will kick in immediately.
The template file is also a good place to make any changes you want to LAYEREVAL and
LAYERNOTIFY (or the dialog equivalents in Layer Settings). If you want your default behavior for new
drawings to be that you are notified about all new layers but only when you plot, set LAYEREVAL to 2
and LAYERNOTIFY to 1 in the template and all new drawings will start with those settings.
This covers setting up defaults for new drawings. Now lets discuss how to force default layer notification
settings for all your legacy drawings.
10
Now, every time you open any drawing or create a new drawing, these settings will be applied. Even if
youve updated your template with different settings, these will take precedence. Of course, layer
notification wont even happen until those legacy drawings are saved in AutoCAD 2008 and the baseline
is created.
A Potential Snag
Depending on how you may have already used layer notification, it is possible to do the previous steps
and still get unexpected notifications. For example, you open a drawing previously saved with a
LAYERNOTIFY value set to notify on open (bit 2) and you still get a notification bubble even though
ACAD2008DOC.LSP has set LAYERNOTIFY to only notify on SAVE and PLOT.
The problem in this scenario is that the system variables are getting set after the layer notification has
already been triggered using the previous setting. It has to do with the order in which things are loaded
and executed in AutoCAD. Your settings in ACAD2008DOC.LSP are executing after the document load
reactors have already done the notification. Once you save that drawing and reopen it you'll find the
notification working as you expect.
11
Tool Unification
Before AutoCAD 2008 there were at least three separate layer state management tools at Autodesk: the
Layer States Manager; the Express Tools LMAN; and the Architectural Desktop Snapshots tool. Each of
these tools worked completely independent of the others, saved layer state information in different
formats and had their own unique behavior.
To unify these separate features into a single, common layer management tool, LMAN and ADT
Snapshots have been replaced with the Layer States Manager and the functionality of all three tools has
been rolled up into one.
All existing LMAN layer states and ADT Snapshots are automatically converted to AutoCAD layer
states when a drawing containing them is opened in AutoCAD 2008.
Direct Access
No longer are you required to open the Layer Properties Manager
just to get at your layer states (Huzzah!).
The Layer States Manager can now be accessed directly using
either the new LAYERSTATE command, the LAS command alias
or the new Layers dashboard panel. Using the Layers dashboard
panel you can save and restore layer states or open the Layer
States Manager - directly from the dashboard.
In addition, the Layers dashboard panel monitors changes to your
layers and will let you know when they are out-of-sync with a layer
state you previously restored. When you restore a layer state, the layer state name is displayed in the
layer state combo box on the dashboard. When anything changes in your layers (new layers, change of
properties, etc.) that combo box will change to display Unsaved Layer State enabling you to quickly
know when something has changed.
12
At the file name prompt, enter the name of the drawing from which you want to import layer states. Then
enter the name of the layer state you want; or use the default * option to import them all; or get a list of
the available layer states with a ?.
When an xref containing layer states is attached to the host drawing, those layer states are also listed in
the Layer States Manager (along with layer states from any nested xrefs). Xref layer states can be
restored however they cant be edited or deleted. Xref layer states are given unique names to easily
identify and separate them from host layer states. The xref layer state name is preceded by the xref
drawings name, separated by a double underscore symbol, e.g., Site Plan__Landscaping. If the xref is
bound to the host drawing, the double underscore is replaced with the standard $0$, e.g., Site Plan$0
$Landscaping.
Xref layer states are removed from the host drawing when the xref is detached or unloaded.
To quickly hide xref layer states in the Layer States Manager, check the Dont list layer states in
xrefs option. The xref layer states are still around but wont be displayed in the list.
13
Minor Tweaks
The layer states list in the Layer States Manager includes a new Same as DWG column to indicate
when the current condition of layers in the drawing matches a layer state in the list. When the Layer
States Manager dialog is opened, the layer states in the list are compared against the layers in the
drawing. If the layers exactly match a layer state, the column will display Yes otherwise No.
The Layer States Manager now displays the name of the last layer state restored in the current drawing (it
used to display the name of the last layer state restored in any drawing in the last AutoCAD session).
The Layer properties to restore options have been moved into a collapsible side panel.
14
If a layer is already on and thawed in model space and should be visible in the viewport, we
VPTHAW it in the viewport and make no change to model space visibility.
If a layer should not be visible in the viewport, we simply VPFREEZE it in that viewport and make
no changes to model space visibility.
If a layer is off and/or frozen in model space and should be visible in the viewport, we VPTHAW it
in the viewport and then make whatever model space changes are necessary (on and/or thaw) so it
will be visible in the viewport.
We've now made a distinction between restoring in paper space and restoring in model space and we
treat them like the two different environments they are. This change was necessary to fix a legacy
problem with restoring layer states in paper space.
Before AutoCAD 2008, if you had a layout with multiple viewports and you needed to restore a different
layer state in each viewport, you ran a very high risk that every subsequent layer state restore, after the
first one, would affect the look of the viewports restored before it. This happened because the model
space on/off and freeze/thaw settings were automatically being restored while in paper space viewports.
Since those settings are global visibility changes, you would have layers that were previously visible in
viewport 1 being globally turned off by the restore to viewport 3. Very frustrating! Now, when restoring a
layer state in a viewport, we do not manipulate the model space on/off and freeze/thaw layer settings
unless it is necessary to make a layer visible in the viewport. This avoids the problem encountered when
restoring multiple layer states to multiple viewports.
So I said all that to say this ...
If you rely on the way that model space visibility changes affect the look of your layout as a byproduct of
restoring a layer state - you will not see this behavior anymore. You may expect to restore a layer state to
a viewport and have the global visibility settings determine the look of the layout (CVPORT = 1) but since
we no longer manipulate model space settings when restoring to paper space (unless necessary), this will
no longer happen.
15
Customizable Columns
The order and visibility of columns in your layer
list is now completely in your control.
Right-click on any column header in the layer list
to display a new context menu (see left image).
From this menu you can: toggle the visibility of
columns by checking or un-checking a column
name; quickly maximize columns so they display
all property information; or reset everything back
to factory defaults.
Picking the Customize option in the menu
opens the Customize Layer Columns dialog
(see right image). Using this dialog you can
show or hide any of the columns (except Name)
or reorder the columns using the Move Up and
Move Down buttons.
You can drag a column to another location right in the Layer Properties Manager layer list. Just leftclick your mouse on a column header, drag it to a new spot and release.
Column settings (like width, order and visibility) are unique to the drawing space in which they were
set. Column settings applied in model space are separate from column settings applied in paper
space. This allows you to create a different working environment for the Layer Properties Manager
depending on which space you are in.
16