Filter lists are composed of pairs of arguments. The first argument identifies the type of filter (for example, an object), and the second argument specifies the value you are filtering on (for example, circles). The filter type is a DXF group code that specifies which filter to use. A few of the most common filter types are listed here.
For a complete list of DXF group codes, see Group Code Value Types in the DXF Reference.
The filter arguments are declared as arrays. The filter type is declared as an integer and the filter value as a variant. Each filter type must be paired with a filter value. For example:
FilterType(0) = 0 'Indicates filter refers to an object type
FilterData(0) = "Circle" 'Indicates the object type is "Circle"
Specify a single selection criterion for a selection set
The following code prompts users to select objects to be included in a selection set, but only adds the selected object if it is a circle:
Sub Ch4_FilterMtext()
Dim sstext As AcadSelectionSet
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
Set sstext = ThisDrawing.SelectionSets.Add("SS2")
FilterType(0) = 0
FilterData(0) = "Circle"
sstext.SelectOnScreen FilterType, FilterData
End Sub