Layer reconciliation. Post 13 in series “AutoCAD Cleanup”

New in AutoCAD 2008 and AutoCAD 2009

in AutoCAD 2008 and 2009 you may have seen the following warning


These messages are produced by layer reconciliation feature.

If layer reconciliation is enabled, when you first open any file in Autocad 2008-2009, the layer baseline list is created in the file. Next time you open the same file, AutoCAD compares the current layer list with the baseline saved in the drawing and if any “new” layers are found it marks them “unreconciled” and groups them into special filter. You can the select the unreconciled ayers and right click to reconcile them(approve). This feature can be very useful in a collaborative environment with extensive usage of XREFs. But like anything new, it takes time to get used to.

Let’s take a look at the settings (variables) which control the behavior of the layer reconciliation

LAYEREVALControls when the Unreconciled New Layer filter list in the Layer Properties Manager is created/evaluated for new layers.
 Type: Integer
 Saved in: Drawing
 Initial value: 1 for 2008 and 0 for 2009
 When LAYEREVAL is set to 1 or 2, layer baseline is created. When LAYEREVAL is set to 0, the Unreconciled New Layer filter is hidden and new layers are not evaluated.
 LAYERNOTIFY Specifies when an alert displays for new layers that have not yet been reconciled.
 Type: Bitcode. To calculate the value of bitcode variable, add all desired options.
 Saved in: Drawing
 Initial value: 15 for 2008 and 0 for 2009

If the LAYEREVAL ≠ 0 and value of LAYERNOTIFY is odd, you will also get the following dialog box that will require you to click Yes or No every time you plot or add a drawing to Publish. It can disrupt your plotting/ publishing workflow.


2009 has an additional variable:

LAYEREVALCTL Controls the overall unreconciled new layer filter list in the Layer Properties Manager which is evaluated for new layers.This system variable also affects whether the new layer notification is displayed or not.
 Type: Binary
 Saved in: registry
 Initial value: 1
0 Disables the evaluation and notification of new layers
 1 Enables the evaluation of new layers on LAYEREVAL settings in DWG file
 Note: LAYEREVALCTL overrides the LAYEREVAL and LAYERNOTIFY setvars when LAYEREVALCTL = 0. It acts like a global off (but not a global on). There is no effect even if LAYEREVALCTL is turned on if LAYERNOTIFY = 0 or LAYEREVAL = 0. LAYEREVALCTL must be set to 1 for LAYERNOTIFY and LAYEREVAL to function correctly.

Note: Initial setting for both LAYEREVAL and LAYERNOTIFY is different for 2008 and 2009, thus users which skipped 2008 did not experience problems with layer reconciliation.

Following table illustrates the differences between 2008 and 2009 and where to set these variables in graphic interface.








































Solutions for 2008:

1. Use templates with desired settings for these variables when creating new files
2. Run script to re-set the variables in existing files.

 blank line

3. If planning to use the feature, reconcile layers once manually or by calling lisp or VBA program from the script

Solutions for 2009

1.Set LAYEREVALCTL=0. It is saved in the registry, so you will not need to go to every file and set LAYEREVAL 0
2. New option in –LAYER command
Run script to reconcile all layers. This will update the baseline. New layers will be evaluated

 blank line
  blank line
 blank line

Layer cleanup scenarios. Post 12 in series “AutoCAD Cleanup”

Depending on the purpose of your cleanup, there may be variety of tasks that you need to perform with the layers:

Task 1.The objects in the drawing are not on the correct layers, and you need to sort them out.

This is a manual process which you have to perform on every file individually. Before you start cleaning up, save the layers state and export it to an external text file. This way you do not have to worry about restoring status quo if you make a mistake. In addition, do not forget about Layer Previous.


Most of the tools you need to sort the content into the correct layers are contaoned in LAYERSII toolbox


My favorite tool for individual layer diagnostic and cleanup is LAYWALK. LAYISO and LAYUNISO could be used as well.

If you can identify criteria for sorting elements to layers (for example: all red elements should go to layer RED, or all blocks – go to layer BLOCKS) you can script that process or at least use QSELECT or selection filters.


Task 2. You need to show/plot XREFs with different symbology (color, lineweight, linetype).

When you approach this task, there are several things to consider:

  • Are element properties (color, lineweight, linetype) of XREF files set ByLayer? If desired, you can use script to force ByLayer
  • What is the VISRETAIN variable setting in the parent(s) file? If desired, script set VISRETAIN
VISRETAIN is a variable which controls if the parent file “remembers” changes to XREF dependent layer properties between AutoCAD sessions. VISRETAIN is saved in the drawing.
 When VISRETAIN =1 in the parent file and you attach (or overlay) an XREF for the first time, AutoCAD creates an internal lookup table in the parent file. This table contains all XREF dependent layers names and their properties as read from the XREF at the time of attachment. When you change XREF dependent layer properties, the internal lookup table holds these changes (only if VISRETAIN =1). If you add layers to the XREF file, a new record with information about the new XREF layers will be added to the table when XREF is reloaded.
  • Are the XREFs already attached?
  • Do you expect updates for the XREFs? If yes, do you expect the layers to be consistent?

Example: Site.dwg is your architectural site plan (VISRETAIN=1). You attached Surv.dwg (survey data) to it and changed properties of all XREF dependent layers from Surv.dwg to gray thin lines (true color 120,120,120, lineweight 0.18mm). Later you receive an update from the surveyor, and there is a new layer “ParkingLOT” (blue, 0.35mm) in the updated Surv.dwg. When you substitute the old version of Surv.dwg with the new one, all XREF dependent layers except ParkingLOT will remain gray and thin, ParkingLOT will be blue and 0.35mm

If you now set VISRETAIN =0 in the Site.dwg, the lookup table will not be saved. Next time you open Site.dwg, the XREF dependent layers properties will be re-read from the XREF file. If you now set VISRETAIN =1 in the Site.dwg, it will not return to your gray thin lines, you will need to re-assign the properties again.
VISRETAIN controls all XREFs together, it cannot control individual XREFs.

When you have multiple similar files with multiple similar XREFs which have the similar file names and identical layer names, you can use some tricks to speed up repetitive tasks.

Super Trick: Say you are working on a hi-rise building (30 floors). File names for all floors follow the naming convention filename-NN.dwg where NN represents floor number. Layers names are identical for all floors.

The layers states (on/off, symbology and freeze status) should be similar for all floors. It would really save you a lot of time if you can set up the layer state for one floor, and then use it for the another 29. The problem is that XREF dependent layer names for different floors have different names because they contain the floor number.

Here is what you can do:

  • Set up the layers the way you want them for one of the floors; in this example, I use 01.
  • Name and save the layer state and export it to an external file Floor1.las
  • Open Floor1.las in any text editor and replace “-01” with “-02”, then save as Floor2.las
  • You now can import and apply Floor2.las to the second floor.

Task 3. You need to change layer properties without changing layer names.

Most common reason to change layer properties is to make them work with a different CTB.
You can use Standards Checker to automatically fix layer properties if the layer names are identical.
If you have a “good” drawing with the layers properties the way you want them, you can save it as a .dws file and use with Standards Checker (Tools->CAD Standards)
You may want to associate standards files with the drawings after they have been cleaned up to catch future deviations before they accumulate.

Task 4. You need to migrate the files from one layer naming standard to another.

The best AutoCAD tool for this job is Layer Translator.
LAYTRANS from command line or Tools->Cad Standards->Layer Translator from the menu.
Layer translator allows you to create a “translation table” which maps the layers from your file to the layers of another .dwg or .dws file. They can be saved and re-used on other files.

Tips on using LAYTRANS:

  • laytrans1Clean up Layer 0 and Defpoint layer first. Then Map same. That will take care of the layers with identical names
    Zoom Extents before you start Layer Translator.
  • In Settings check Show layer contents when selected. That will visually isolate selected layers display. Use Selection Filter if needed.
  • Map the layers that you can visually identify first. Save the Layer Translation Mappings. Translate.

Use LAYWALK and other layer tools as described in task1 to clarify and sort out messed up layers, then go back to translation

Limitations of LAYTRANS:

  • Works on one file at a time. Cannot batch translate multiple files.
    Even when all options are selected, the nested objects in blocks are NOT forced to color and linetype ByLayer. Use SETBYLAYER in AutoCAD2008-2009.
  • Missing features: options to Force object Lineweight and Plotstyle to ByLayer.
  • Can’t zoom in/out while in Layer Translator
  • Layer Descriptions will be lost in translation.

Using “Other Software” for batch processing of layers and other tasks

MicroStation translation tables are Excel files, and can be easily edited for such tasks as renaming layers by appending, pre-pending and partial name substitution. You can also force color, linetype and lineweight to ByLayer for the objects nested in blocks

Best of all, MicroStation can batch translate layers in multiple files. Use latest versions for compatibility with latest AutoCAD file format.

Potential problems to watch for while cleaning up layers

Special layers. No graphic elements should be on Layer 0 or Defpoints.

  • A layer is identified by its name, and when the name is changed, other files this file is referenced to (parent files) are not ”aware” of that change.
    If you change XREF dependent layer names, the XREF dependent layers properties specifically assigned in the parent file using VISRETAIN=1 will stop working.
    Similarly, when you rename XREF layers, the freeze and on/off (and for 2008 VP symbology settings) information in the plot sheet will be lost. In addition, this layer may need to be reconciled.
    If you use layer states and export them outside of your drawing file, after renaming the layers the exported layer states will be unusable.
  • Always keep in mind that color, lineweight and, in many cases, linetype and plot style for graphic objects are set to “ByLayer”, so any change to layer properties has to be coordinated with the plot style table you are going to use.
  • In previous versions of AutoCAD you could only assign VP Freeze to a layer. Now in addition you can assign VP Color, VP Linetype, VP Lineweight and, for the DWG of STB flavor, VP Plot style. In other words, your layers may look and plot differently in different viewports.