Specify Multiple Criteria in a Selection Set Filter List

AutoCAD ActiveX

 
Specify Multiple Criteria in a Selection Set Filter List
 
 
 

To specify multiple selection criteria, declare an array containing enough elements to represent each criterion, and assign each criterion to an element.

Select objects that meet three criteria

The following code specifies two criteria: the object must be a circle and it must reside on layer 0. The code declares FilterType and FilterData as arrays of two elements, and assigns each criterion to an element:

Sub Ch4_FilterBlueCircleOnLayer0()
   Dim sstext As AcadSelectionSet
   Dim FilterType(1) As Integer
   Dim FilterData(1) As Variant
   Set sstext = ThisDrawing.SelectionSets.Add("SS4")
      
   FilterType(0) = 0
   FilterData(0) = "Circle"
      
   FilterType(1) = 8
   FilterData(1) = "0"
      
   sstext.SelectOnScreen FilterType, FilterData
      
End Sub