PDA

View Full Version : about Layer Filters


hifrank001
07-07-2004, 04:01 AM
I got a lot of Layer Fitlers in a drawing from other people, How can I delete all ot them at one time?

thanks.

architech
07-07-2004, 05:43 PM
I believe you can't do this at once. :evil:

However, in AutoCAD 2004, that button ... becomes available. :roll:

Maybe someone here can OR has figured out how to copy that command out for the older versions of AutoCAD. :?: :idea:

Sorry I couldn't be anymore help. :oops:

I have it here.
So if you upload it I can delte them out and save it back to 2Ki .... :?:
The best I can do.

CarLB
07-07-2004, 06:50 PM
You can delete all with a routine. I've seen many; copied this from The Swamp:

(defun C:LFD ()
(vl-Load-Com)
(vl-Catch-All-Apply
'(lambda ()
(vla-Remove (vla-GetExtensionDictionary
(vla-Get-Layers
(vla-Get-ActiveDocument
(vlax-Get-Acad-Object))))
"ACAD_LAYERFILTERS")))
(princ "\nAll layer filters have been deleted.")
(princ))

For a more powerful tool that also deletes Unnamed Groups, Registered Apps, etc, get the free download of CDGPurge:

http://www.caddevelopmentgroup.com/Downloads.htm

architech
07-07-2004, 11:53 PM
See. :mrgreen:
Ask and you shall recieve. ::Beer::

Thank you "CarlB". ::thumbs :

hifrank001
08-07-2004, 02:33 AM
sorry, i don't know autolisp.

and i also copy those sentences in Command, it doesn't work. the layer control just show up, and the filters are still there.

could u please explain how to run it? thanks a lot.

CarLB
08-07-2004, 06:53 AM
It would work on the command line if there weren't the spaces at the end of each line, and then type "LFD" to run it. You could copy the code into a text file, save it with a ".lsp" extension, load it using Tool>>AutoLisp >>(select file)>>Load. "Type LFD" to run it. The following format should be easier to cut & paste:

(defun C:LFD ()
(vl-Load-Com)
(vl-Catch-All-Apply
'(lambda ()
(vla-Remove (vla-GetExtensionDictionary
(vla-Get-Layers
(vla-Get-ActiveDocument
(vlax-Get-Acad-Object)
)
)
)
"ACAD_LAYERFILTERS")
)
)
(princ "\nAll layer filters have been deleted.")
(princ)
)

hifrank001
10-07-2004, 03:38 AM
it works! and it save me time a lot.

thank u, guys