Results 1 to 6 of 6

Thread: exclude some layers from PURGE?

  1. #1
    AUGI Addict Maverick91's Avatar
    Join Date
    2000-12
    Location
    Grand Prairie, Texas, USA
    Posts
    1,324
    Login to Give a bone
    0

    Default exclude some layers from PURGE?

    I use the PURGE and the AUDIT commands regularly to keep the drawings clean (including register applications). I have a tool palette button to automate this. I'd like to keep some layers, even if they're not used; they may get used later when the drawings are more developed. Is there a way I can keep some layers from our standard template from being deleted? TIA.

  2. #2
    All AUGI, all the time CADastrophe's Avatar
    Join Date
    2012-01
    Location
    Site of the next CADaclysm
    Posts
    813
    Login to Give a bone
    0

    Default Re: exclude some layers from PURGE?

    Quote Originally Posted by Maverick91 View Post
    I use the PURGE and the AUDIT commands regularly to keep the drawings clean (including register applications). I have a tool palette button to automate this. I'd like to keep some layers, even if they're not used; they may get used later when the drawings are more developed. Is there a way I can keep some layers from our standard template from being deleted? TIA.
    Perhaps you can create a block containing those particular Layers, have the button insert it prior to Purge, and then delete it following the command.

  3. #3
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Colorado Springs, CO
    Posts
    369
    Login to Give a bone
    0

    Default Re: exclude some layers from PURGE?

    We use a layer creation lisp, this allows us to purge regularly but still have all of our layers available to us. It's got a button, it's in the right click menu, or it can be typed. This ensures that no matter how a user prefers to work that they have easy access to the command.

    I also load our custom linetype file at the start of the lisp.

    Code:
    (DEFUN C:CEILAYER ()
      
      (setq oldlayer (getvar "CLAYER"));get current layer
      (setq oldcmdecho (getvar "cmdecho"))
      (setvar "cmdecho" 0)
    ;;set linetype scale
      (COMMAND "LTSCALE" ".15")  
    
    ;;;load CEI linetypes
    (setvar "Expert" 3)
    (command "._linetype" "_load" "*" "..../CEI.lin" "")
    (setvar "Expert" 0)
    ;;;ONE LINE LAYERS
    (COMMAND "LAYER" "MAKE" "E-1LIN" "C" "134" "" "")
    (COMMAND "LAYER" "MAKE" "E-1LIN-DEMO" "C" "40" "" "LT" "DASHED" "" "")
    (COMMAND "LAYER" "MAKE" "E-1LIN-EXST" "C" "84" "" "")
    (COMMAND "LAYER" "MAKE" "E-1LIN-IDEN" "C" "14" "" "")
    (COMMAND "LAYER" "MAKE" "E-1LIN-DEMO-IDEN" "C" "14" "" "")
    (COMMAND "LAYER" "MAKE" "E-1LIN-EXST-IDEN" "C" "14" "" "")
    (COMMAND "LAYER" "MAKE" "E-1LIN-IDEN-NPLT" "C" "5" "" "P" "N" "" "")  
    
    ;;;; other layers here
    
    ;;reset existing layer
      (setvar "CLAYER" oldlayer)
      (setvar "cmdecho" oldcmdecho)
    (PRINC)
      )
    Last edited by Coloradomrg; 2013-11-25 at 05:00 PM. Reason: added code example

  4. #4
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: exclude some layers from PURGE?

    or you can use a script to do the same thing.

  5. #5
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: exclude some layers from PURGE?

    You could...

    ...create an entity on that layer and make it invisible.

    ...add an entity on that layer to one of your used blocks

    ...attach some xdata to layer 0 that contains a reference to the layer(s) you want to keep.



    There is some more detail on the last option, including some lisp code here:

    http://forums.autodesk.com/t5/Visual...rs/m-p/1631434
    R.K. McSwain | CAD Panacea |

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: exclude some layers from PURGE?

    Quote Originally Posted by Maverick91 View Post
    I use the PURGE and the AUDIT commands regularly to keep the drawings clean (including register applications). I have a tool palette button to automate this. I'd like to keep some layers, even if they're not used; they may get used later when the drawings are more developed. Is there a way I can keep some layers from our standard template from being deleted? TIA.
    Add a Layer State to the drawing or template file that contains just the layers you'd like to keep and restore it after purge.

Similar Threads

  1. Purge everything except layers
    By bernt.noodt in forum AutoLISP
    Replies: 14
    Last Post: 2011-10-27, 08:22 AM
  2. Layers that don't purge
    By markwise in forum AutoCAD General
    Replies: 4
    Last Post: 2009-09-14, 02:36 PM
  3. Unseen layers-Purge
    By chrisr in forum AutoCAD General
    Replies: 5
    Last Post: 2008-12-01, 11:24 PM
  4. Managing Layers, unable to purge / remove Layers
    By asenbauer in forum AutoCAD General
    Replies: 3
    Last Post: 2006-11-10, 09:50 AM
  5. Unable to Purge Layers
    By shyj9 in forum AutoCAD General
    Replies: 10
    Last Post: 2006-08-07, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •