You don't have to delete each layer filter, just delete
the ACAD_LAYERFILTERS parent dictionary, and that's
it.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
wrote in message news:5718396@discussion.autodesk.com...
Hi
I am trying to write code in VB.NET to delete all the layer filters in a bunch of drawings (AutoCAD 2008). Some of the drawings have lots of junk layer filters (numbers running into 20-30000's) and hence, the need to automate this.
I have been able to automate the code but the problem is that it takes a lot of time to delete( around 2-3 minutes per drawing). Can someone suggest improvements to it or another alternative? (something as fast as the "Delete" button in the form that comes up after typing the Filters command). Here is my code
Dim acadDictionary As AcadDictionary
Dim layerFilter As Object
Dim xRecord As AcadXRecord
acadDictionary = _MyAutoCAD.ActiveDocument.Layers.GetExtensionDictionary
layerFilter = acadDictionary.Item("ACAD_LAYERFILTERS")
For Each xRecord In layerFilter
xRecord.Delete()
Next
Thanks
Saumitra