Thank you Jeff! That worked perfectly. I also searched google and figured out how to use conditional statements and create a multiple typed value selection set. Here is the code that worked for me.
' <summary>
' Tests the PickSet Flag on duct and duct fittings
' </summary>
<Autodesk.AutoCAD.Runtime.CommandMethod("PropertySetTools", "TestPickfirst", CommandFlags.Modal + CommandFlags.UsePickSet)> _
Public Sub Command_TestPickFirst()
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim ed As Editor = doc.Editor
Dim db As Database = doc.Database
'Create an array of DXF Names to use in a filter
Dim AECB_TypedValues() As TypedValue = {New TypedValue(DxfCode.Operator, "<OR"), _
New TypedValue(DxfCode.Start, "AECB_DUCTFITTING"), _
New TypedValue(DxfCode.Start, "AECB_DUCT"), _
New TypedValue(DxfCode.Operator, "OR>")}
'Create the filter and set it equal to the DXF Names created previously
Dim filter As New SelectionFilter(AECB_TypedValues)
'Create a Prompt Selection Option
Dim pso As New PromptSelectionOptions
'Create a message to display if no fittings are picked before the command is ran
pso.MessageForAdding = vbLf + "Select fittings: "
'Get the fittings from the pickfirst selection or from the message
Dim result As PromptSelectionResult = ed.GetSelection(pso, filter)
'Display the number of objects selected
If result.Status = PromptStatus.OK Then
ed.WriteMessage(String.Format("{0} objects selected", result.Value.Count.ToString))
End If
End Sub
My next question would be do you happen to know how to filter a classification? Classifications of AEC objects are stored in extension dictionaries. I am just not sure how to go about using that in the dxf filter.
Thanks again for the response.