View Full Version : Layer Filters...
bnutkins
2005-06-01, 08:28 PM
Can anybody help me with a way to delete in masses layer filters. We are using Acad 2002 and evrytime I get a drawing from our civil engineer and other places it has hundreds of layer filters and it makes the file size huge. I fon't have the time to delete them one by one.
bbapties
2005-06-01, 08:33 PM
See this post (http://forums.augi.com/showthread.php?t=16340)
Hope this helps...
madcadder
2005-06-01, 08:34 PM
(defun c:lfd (/ dicts dict filtr)
(vl-Load-Com)
(vl-Catch-All-Apply
'(lambda ()
(setq dicts (vla-GetExtensionDictionary
(vla-Get-Layers
(vla-Get-ActiveDocument (vlax-Get-Acad-Object))
)
)
)
(vlax-for dict dicts
(if (and (= (vla-get-name dict) "ACAD_LAYERFILTERS")
(> (vla-get-count dict) 0)
)
(progn (vlax-for filtr dict (vla-delete filtr)))
)
)
)
)
(princ)
)
tflaherty
2005-06-01, 10:57 PM
I had a similar question the other day and through the responses found the above mentioned routine and it works great.
I deleted over 19,000 layer filters from some of our drawings. My question is where the heck did they all come from. We don't use any outside sources or any consultant drawings, so how to they get made in the first place??
bnutkins
2005-06-01, 11:02 PM
thanks for the link but how do I get it to run?
bnutkins
2005-06-01, 11:03 PM
nevermind i got it thanks for your guys help.
LanceMcHatton
2005-06-02, 03:40 PM
I deleted over 19,000 layer filters from some of our drawings. My question is where the heck did they all come from. We don't use any outside sources or any consultant drawings, so how to they get made in the first place??
Anyone can make a layer filter and it sounds like maybe some of your coworkers have. Also, even though you don't use "outside sources", some of your coworkers may be using drawings they have from other offices they have worked at. Furthermore, old drawings that you might re-use may have filters, too. Every time you insert or xref a drawing, they follow and stick like glue.
I'd like to offer some advice if I may. I don't know how my lisp compares to the ones in this thread, but I have changed my layer button (on a toolbar) to execute the DeleteLayerFilters lisp and THEN execute the layer command. That way, I never have to think about them or see them. They're just GONE. If everyone in your office does the same thing, you shouldn't have any more filter problems.
Unless, of course, you actually USE layer filters, then you might be out of luck. Perhaps the lisp can be changed to only delete layer filters that don't have a certain prefix. For example, my company is G.C. Wallace, Inc. Any layer filters we use could have a prefix of GCW<filtername> so the list could delete everything but GCW*. I don't know, just a thought.
Wanderer
2005-06-02, 03:43 PM
Unless, of course, you actually USE layer filters, then you might be out of luck. Perhaps the lisp can be changed to only delete layer filters that don't have a certain prefix. For example, my company is G.C. Wallace, Inc. Any layer filters we use could have a prefix of GCW<filtername> so the list could delete everything but GCW*. I don't know, just a thought.
just as a matter of trivia, this issue was addressed in 2006 (http://forums.augi.com/showthread.php?p=129997&highlight=filters+2006#post129997)
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.