Monday, April 9, 2007

Purge reconciled layer information in AutoCAD 2008

I looked at where data is saved when a layer is reconciled in AutoCAD 2008.
The so called baseline of layers is saved in an Extension Dictionary on each layer and adds of course to the size of the file.
I made a test drawing with 1000 layers. Not so much if you work with many xrefs that has many layers. With all layers reconciled the size was 113 KB. After purging with the code below the size come down to 81 KB. 32 extra KB per 1000 layers. No big deal but here is a way to purge them using AutoLISP.
Download for PurgeReconciledLayers.LSP
;;; PurgeReconciledLayers.LSP ;;; ;;; By Jimmy Bergmark ;;; Copyright (C) 2007 JTB World, All Rights Reserved ;;; Website: www.jtbworld.com ;;; E-mail: info@jtbworld.com ;;; 2007-04-05 - First release ;;; Written for AutoCAD 2008 ;;; Purge all information about reconciled layers in the drawing (defun PurgeReconciledLayers () (vl-load-com) (vlax-for layer (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object) ) ) (vl-Catch-All-Apply '(lambda () (vla-Remove (vla-GetExtensionDictionary layer ) "ADSK_XREC_LAYER_RECONCILED" ) ) ) (vl-Catch-All-Apply '(lambda () (vla-delete (vla-GetExtensionDictionary layer ) ) ) ) ) (setvar "LAYEREVAL" 0) (setvar "LAYERNOTIFY" 0) (princ) ) ; Remove the row below if you don't want to run the code automatically when the AutoLISP file is loaded. (PurgeReconciledLayers)

3 comments:

  1. Restored comment
    Anonymous said...

    Thank you so much~~
    February 27, 2008

    ReplyDelete
  2. Thanks for the lisp. Iam wondering, what happens with the reconciled layers? Autodesk didn't explain that much in the help files.

    ReplyDelete
  3. When a layer is reconciled nothing happens with it. This functionality is for the purpose to have better control on when new layers are added and so on.

    ReplyDelete