Layer0 and Defpoints . Post 11 in series “AutoCAD Cleanup”

Layer 0 and Defpoints layers are special. These layers should not to be used to create graphic content. Layer 0 should be used only to create block definitions, Defpoints layer is used by AutoCAD to create invisible definition points for other elements. These layers behave in a special way: they cannot be deleted and fall flat into the corresponding layer of a parent file when the file containing these layers is attached or overlaid to another file.

Example: A-Plan.dwg is a construction plan with walls drawn on layer 0 and M-Plan.dwg is a piping plan with hot water pipes drawn on its layer 0. A-Plan.dwg is overlaid into M-Plan.dwg to be used as a background. You want to see/plot walls as thin lines and pipes as thick lines. However you cannot separate layer 0 of parent M-Plan.dwg .dwg and A-Plan.dwg

The Defpoints layer behaves in a similar way. On earlier versions of AutoCAD many users learned to use the Defpoints layer as storage for elements they did not wish to plot (viewports, alignment lines, sometimes XREFs and such). However starting from AutoCAD 2000, any layer can have the non-plot property, and it is a good practice to create a special layer(s) to contain those elements.

It is best to start with cleaning up Layer 0 and Defpoints.

I wrote a little LISP routine to move all objects from Layer 0 to a new layer “from0”. After it is loaded, you can run it by typing “from0”at the command line.

(defun c:from0 ()
 (setq ssl0 (ssget “x” ‘((8 . “0″))))
 (COMMAND “-layer” “N” “from0″ “”)
 (COMMAND “chprop” ssl0 “” “la” “from0″ “”)

You can also run it on multiple files using ScriptPro

However if you have graphic elements on the Defpoins layer, or do not want to dump everything from layer 0 into one layer, you will have to do it manually.

To identify objects on these layers, you can use LAYWALK (Express Tools in earlier releases). I will not duplicate the HELP file of LAYWALK here but suffice it to say that it is the most powerful tool for diagnosing layer problems and sorting them out. It can answer two questions:

  • What layers the objects are on?
  • What objects reside on these layers?


Undocumented trick: you can use your mouse wheel to ZOOM while in LAYWALK. Just click on Select by element, and wheel forward to zoom in, wheel back to zoom out, double click on a wheel to zoom extents, or press and drag to pan. When done navigating, press Escape to return to LAYWALK without change. Explore right-click menu.

Scale List cleanup . Post 10 in series “AutoCAD Cleanup”

From Scale List Cleanup Utility README.txt:

Description of Problem

When a file contains excess scales, performance may be negatively affected. Eventually, the file may become unusable. To use the file, some scales must be removed. This utility repairs affected files by removing excess scales.

NOTE: Nested external references (xrefs) may produce excess scales. To correct this problem, install AutoCAD 2008 Service Pack 1 or corresponding service packs for AutoCAD-based products. The Scale List Cleanup Utility repairs files affected before the necessary service pack was installed.

Affected Products

AutoCAD® 2008-based products, including DWG TrueViewTM 2008
AutoCAD 2009-based products, including DWG TrueView 2009

Not every scale containing “XREF” in its name is a bug. Legitimate” XREF scales:

  • When units are different
  • When proxy objects are present
  • When these scales are already used in page setups, viewports or anywhere else where scale is used.
  • When scale list in XREF contains scales or definitions which are not present in the parent file

How to clean:

  • Use Scale Cleanup Utility (download from Autodesk website)
  • Alternatively, add the following line (before Qsave line) to any of the cleanup scripts you run on your files:

Proxy objects cleanup . Post 9 in series “AutoCAD Cleanup”

A proxy object is a substitute for a custom object created by an AutoCAD add-on application such as AutoCAD Architecture, Civil 3D and others. Proxy objects may look OK but erasing and moving an object, or changing object properties may not be possible on a proxy object, depending on the application that created it.

When you open a drawing, you might see a Proxy Information dialog box (depends on PROXYNOTICE variable setting). The dialog box tells you the total number of proxy objects in the drawing (both graphical and nongraphical) and the name of the missing application and provides additional information about the proxy object type and display state.

proxynoticeAn Object Enabler lets you view and somewhat edit proxy objects in AutoCAD when add-on application is not present. You can tell AutoCAD to search and install available enablers automatically, but that setting may slow down your system and may be intercepted by your network security policies. It is much better to install all of them on every machine in the office.
Better yet, Object Enablers allows you to convert proxy objects to plain AutoCAD

Following script can be used to convert file with proxy objects to the plain AutoCAD file (provided you have an object enabler installed).

 B N
 blank line
 blank line
 blank line
 blank line

Same script explained line-by line:

1 -EXPORTTOAUTOCAD prerequisite: object enablers for proxy parent application
2 B N set BIND option to NO (can be used with YES, if you want to bind all XREFs)
: Set PREFIX option to “ACAD\”. This will export the file into ACAD subfolder of current folder .
This subfolder must exist before
you run the script.

blank line


blank line


blank line


blank line