Results 1 to 2 of 2

Thread: Filter type and Filter data is not working

  1. #1
    100 Club
    Join Date
    Vadodara, India
    Login to Give a bone

    Default Filter type and Filter data is not working


    I want to select only Lines but filter type and data is not working. it says invalid filter type

    setColl = AcadDoc.SelectionSets
            For Each objSSet1 In setColl
                If objSSet1.Name = setName Then
                    Exit For
                End If
            objSSet1 = AcadDoc.SelectionSets.Add(setName)
            'End With
            Dim FilterType(0) As Integer
            Dim FilterData(0) As Object
            FilterType(0) = 0
            FilterData(0) = "Line"
            objSSet1.SelectOnScreen(FilterType, FilterData)
    Can any one help me.
    Last edited by Opie; 2021-01-07 at 01:38 PM. Reason: [code] tags improve readability

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    Turlock, CA
    Login to Give a bone

    Default Re: Filter type and Filter data is not working

    Here's a C# example of how to do it using the managed api. Note that the SelectAll method accepts a single array.
                // Get a selection set of ents whose color is not ByLayer.
                TypedValue[] tvls = new TypedValue[2];
                tvls.SetValue(new TypedValue((int)DxfCode.Operator, "!="), 0);
                tvls.SetValue(new TypedValue((int)DxfCode.Color, 256), 1); //Color 0 = ByLayer
                SelectionFilter sf = new SelectionFilter(tvls);
                PromptSelectionResult PSR = Active.Editor.SelectAll(sf);
    If you still want to use the COM method, the example in this Help topic filters for a circle. Note that the Select method takes variant arrays, so you have to assign your filter data to variant arrays first before trying to use it in the Filter argument.

    BTW, to put your code in a CODE window, click on the Go Advanced button, then select the # button to insert CODE tags.
    Last edited by Ed Jobe; 2021-01-07 at 04:02 PM.
    C:> ED WORKING....


Similar Threads

  1. 2019: when set up a structure column schedule, Why the Field "Type" is not in the filter list?
    By 1143413815422067 in forum Revit Architecture - General
    Replies: 0
    Last Post: 2018-09-29, 01:38 AM
  2. Replies: 0
    Last Post: 2017-06-15, 07:31 PM
  3. 2014: Floors and view filter not working as expected
    By david_peterson in forum Revit Architecture - General
    Replies: 2
    Last Post: 2014-05-06, 03:52 PM
  4. Not able to choose my custom filter system type!!??
    By ncostab in forum Revit MEP - General
    Replies: 1
    Last Post: 2010-03-19, 04:21 PM
  5. Point (co-ordinate) filter not working as expected
    By sarahjane in forum AutoCAD General
    Replies: 6
    Last Post: 2005-11-15, 06:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts