Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Delete ACAD layer filters 1

Status
Not open for further replies.

raybaird

Technical User
Jan 13, 2003
1
US
My ADT 3 (ACAD 2000i) files have become huge, 4-5 meg even with almost no entities on them. I searched Tek-Tips & found Thread687-843050 by "Borgunit" that told me to check Layer Filters. Sure enough, each dwg had 10's of 10,000's of filters. "Borgunit" gave a short lisp program to erase all filters at once. I tried to make the program work but am not familiar with "lisp", so it didn't work. It took 4-5 hours, but I deleted all the filters one at a time. Sure enough, the file went from 3.9 meg to 163k. Could "Borgunit" or anyone else help me get a functioning lisp program for this? Would be appreciated.
 
Perhaps the code Borgunit posted was Ok and you just didn't run it correctly. Did you save it to a text file with a ".lsp" extension, load it with "Tools>>Load application>>(browse & select)>>Load

Then type "LFD" or whatever the startup command was?

here's code I have for this:

(princ "\nType LFD to start")
(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))
 
here is the code i use. it deletes filters for all releases of cad. Autodesk changed the extension dictionary for release 2005 and later. pste it into a text document with the .lsp file extension and use appload in Autocad. type LFD to use the command
Code:
(defun C:LayerFiltersDelete ()
  (vl-Load-Com)
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
	 (vla-GetExtensionDictionary
	   (vla-Get-Layers
	     (vla-Get-ActiveDocument
	       (vlax-Get-Acad-Object)
	     )
	   )
	 )
	 "acad_layerfilters"
       )
     )
  ))

;this sections deletes 2005 layer filters and later

(defun c:LayerFiltersDelete2 ()
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
	 (vla-GetExtensionDictionary
	   (vla-Get-Layers
	     (vla-Get-ActiveDocument
               (vlax-Get-Acad-Object))))
	 "AcLyDictionary")))
)
  
(defun C:LFD () 
(c:LayerFiltersDelete)
(c:layerfiltersdelete2)
(princ "\nAll layer filters have been deleted.")
(princ)
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top