Author Topic: Named Layer Filters  (Read 1851 times)

0 Members and 1 Guest are viewing this topic.

Matersammichman

  • Guest
Named Layer Filters
« on: June 07, 2006, 01:18:00 PM »
Two questions:
1. Anyone have code to purge Named Layer Filters?
2. What's the difference between Property Filters, Group Filters, and Standard Filters?

Bob Wahr

  • Guest
Re: Named Layer Filters
« Reply #1 on: June 07, 2006, 01:24:16 PM »
1)  This was quick and dirty some time back.  As I remember it worked fine.
Code: [Select]
Option Explicit
'Private Sub AcadDocument_BeginSave(ByVal FileName As String)
Sub purge_em()
Dim strSubName As String
Dim objDictionary As AcadDictionary
Dim objFilter As AcadObject

On Error GoTo Err_Ctrl

strSubName = "PurgeFilter.DVB"

Set objDictionary = ThisDrawing.Layers.GetExtensionDictionary("ACAD_LAYERFILTERS")
For Each objFilter In objDictionary
  objFilter.Delete
Next

If Left(ThisDrawing.GetVariable("ACADVER"), 2) = "16" Then
  Set objDictionary = ThisDrawing.Layers.GetExtensionDictionary("ACLYDICTIONARY")
  For Each objFilter In objDictionary
    objFilter.Delete
  Next objFilter
End If
Exit_Here:
  Exit Sub
 
Err_Ctrl:
  Select Case Err.Number
    Case -2145386476
      Err.Clear
      Resume Next
    Case Else
      MsgBox "An Error occurred in " & strSubName & "." & vbCr & vbCr _
        & "Error number: " & Err.Number & vbCr & Err.Description & vbCr & vbCr _
        & "DUM DIGga DUM DIGga DIGga DIGga DUM", vbCritical, _
        "Error in " & strSubName
      GoTo Exit_Here
  End Select
     
End Sub
2)
Quote
Layer property filters: Includes layers that have names or other properties in common. For example, you can define a filter that includes all layers that are red and whose names include the letters mech.
Layer group filters: Includes the layers that are put into the filter when you define it, regardless of their names or properties.

Maverick®

  • Seagull
  • Posts: 14778
Re: Named Layer Filters
« Reply #2 on: June 07, 2006, 02:11:02 PM »
Quote
& "DUM DIGga DUM DIGga DIGga DIGga DUM"

 :-D :-D

Bryco

  • Water Moccasin
  • Posts: 1864
Re: Named Layer Filters
« Reply #3 on: June 07, 2006, 02:32:41 PM »
There's Maverick getting all vbCritical.