stryder444 Posted March 7, 2014 Share Posted March 7, 2014 Hello, I am setting up a layers list for my business, so there will be one list of layers that everyone can pick from, but I was wondering if there is a way to prevent unused layers from being purged whenever the PURGE command is used. I want to stop any layers from being purged, so that the layers list remains the same throughout. Is there a way in which to do this? Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 7, 2014 Share Posted March 7, 2014 Put an object on that layer? Quote Link to comment Share on other sites More sharing options...
stryder444 Posted March 7, 2014 Author Share Posted March 7, 2014 The problem is that there are quite a few layers so it will be quite difficult to create an object or key containing all the layers. Quote Link to comment Share on other sites More sharing options...
dbroada Posted March 7, 2014 Share Posted March 7, 2014 The object could be a 1 micron high piece of text. Or you can create a block with an item on each layer. OK, so its going to be large but will only need doing once. Now insert this block on a non-plot or off (even frozen) layer and it won't be accidentally purged. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted March 7, 2014 Share Posted March 7, 2014 or a block of point objects and it is not necessarily to be inserted into a drawing to avoid purging its related layers ( if you purge layers only of course and not purge all). Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 7, 2014 Share Posted March 7, 2014 You say it's your business. Since you don't like the obvious answer I have a very simple one for you. Tell your employees if they purge any unused layers from a company drawing they'll be fired. Quote Link to comment Share on other sites More sharing options...
stryder444 Posted March 7, 2014 Author Share Posted March 7, 2014 When did I say I didn't like the answer - I said that it would take a bit of time to do. No criticism of the answer at all. Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 7, 2014 Share Posted March 7, 2014 It was implied. Oh, this is going to take too much time. No denying the thought crossed your mind. Here's a answer you are sure to like. Use the built-in AutoCAD Standards Tester to keep the layers from being deleted. Yes, it will take time to set up too but it is the one sure fire way to retain your layers. Crap. AutoCAD 2007? Time to upgrade. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted March 7, 2014 Share Posted March 7, 2014 See if anything in this thread helps http://www.cadtutor.net/forum/showthread.php?69649-Keep-layers-from-being-deleted-or-purged Quote Link to comment Share on other sites More sharing options...
Mike_Taylor Posted March 7, 2014 Share Posted March 7, 2014 We had a similar issue here with people purging layers and creating there own, rather than fighting against them purging. We went along the lines of using a script to replace the purge command that didn't purge layers, but there are some that need purging sometimes, we then decided rather than fight it, we created a script that automatically loaded all the layers we need. Not only that but you can restore the layers deleted using they LAYDEL command as well. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted March 7, 2014 Share Posted March 7, 2014 Add name of your layers into the following routine and you can change the name of the routine to be instead of the purge command call purge and it would purge everything in the drawing except the layer names that you'd add to it . (defun c:Test (/ *error* l lst) (defun *error* (u) (if doc (vla-endundomark doc) ) (princ (strcat "\n Error:" u)) ) (or doc (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) ) (vla-startUndomark doc) (foreach l '("Layer1" "Layer2" "Layer3") (setq lst (cons (entmakex (list '(0 . "POINT") '(10 0. 0. 0.) (cons 8 l))) lst ) ) ) (command "_.-purge" "All" "*" "N") (foreach o lst (vl-catch-all-apply 'entdel (list o))) (vla-endundomark doc) (princ) ) (vl-load-com) Quote Link to comment Share on other sites More sharing options...
steven-g Posted March 7, 2014 Share Posted March 7, 2014 I use the point in a corner of my template titleblock, well a few points, each on a seperate layer, stops me purging out my own layers. And that is copied into each sheet size, just in case I delete all but one layout size. I also have several dims placed in model space to keep dimstyles in the template. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.