Public Overrides Sub Execute()
Dim db As AADS.Database = AADS.HostApplicationServices.WorkingDatabase
Dim laytree As AALM.LayerFilterTree = db.LayerFilters
If laytree.FilterExists(NONXREF_FILTER_NAME) = False Then
Dim newfilter As New AALM.LayerFilter
newfilter.Name = NONXREF_FILTER_NAME
newfilter.FilterExpression = "NAME==~*|*" '<--------------------------------------------
' Add the Layer Filter to the NestedFilters of the LayerFilters
laytree.Root.NestedFilters.Add(newfilter)
laytree.Root.GenerateNested()
'Use the constructor to make the Layer Filter current
'and update the Layer Palette. Without this you can run the
'LAYER command and see the new layer filter
db.LayerFilters = New AALM.LayerFilterTree(laytree.Root, laytree.Root) '<--------------------------------------------
End If
End Sub