TheSwamp
Code Red => VB(A) => Topic started by: Matersammichman 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?
-
1) This was quick and dirty some time back. As I remember it worked fine.
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) 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.
-
& "DUM DIGga DUM DIGga DIGga DIGga DUM"
:-D :-D
-
There's Maverick getting all vbCritical.