Help with Selection Set filtering...

Discussion in 'AutoCAD' started by Matthew.Corbin, Jan 6, 2004.

  1. Could anyone help me out with a filter i'm trying to create. I want the selection set to include text and mtext as well as all blocks whose names are dia,n,hex,sqn, and delta. I've looked in ACAD help files but haven't found an example that does this. I think the "and" & "or" are confusing me because when I do this nothing happens:
    FilterType (0) = -4
    FilterData (0) = "<or"
    FilterType (1) = 0
    FilterData (1) = "text"
    FilterType (2) = 0
    FilterData (2) = "mtext"
    FilterType (3) = -4
    FilterData (3) = "or>"
    FilterType (4) = -4
    FilterData (4) = "<and"
    FilterType(5) = 0
    FilterData(5) = "insert"
    FilterType(6) = -4
    FilterData(6) = "<and"
    FilterType(7) = -4
    FilterData(7) = "<or"
    FilterType(8) = 2
    FilterData(8) = "dia"
    FilterType(9) = 2
    FilterData(9) = "n"
    FilterType(10) = 2
    FilterData(10) = "hex"
    FilterType(11) = 2
    FilterData(11) = "sqn"
    FilterType(12) = 2
    FilterData(12) = "delta"
    FilterType(13) = -4
    FilterData(13) = "or>"
    FilterType(14) = -4
    FilterData(14) = "and>"

    Any ideas?
    Thanks,
    Matthew Corbin
     
    Matthew.Corbin, Jan 6, 2004
    #1
  2. Sub Test()
    Dim dxfCodes(0 To 6) As Integer
    Dim dxfData(0 To 6) As Variant

    dxfCodes(0) = -4: dxfData(0) = "<OR"
    dxfCodes(1) = 0: dxfData(1) = "TEXT,MTEXT"
    dxfCodes(2) = -4: dxfData(2) = "<AND"
    dxfCodes(3) = 0: dxfData(3) = "INSERT"
    dxfCodes(4) = 2: dxfData(4) = "Dia,N,Hex,Sqn,Delta"
    dxfCodes(5) = -4: dxfData(5) = "AND>"
    dxfCodes(6) = -4: dxfData(6) = "OR>"

    Dim ss As AcadSelectionSet
    Set ss = ThisDrawing.PickfirstSelectionSet
    ss.Select Mode:=acSelectionSetAll, FilterType:=dxfCodes,
    FilterData:=dxfData
    MsgBox ss.Count
    End Sub


    (You closed your first OR too soon. Not to mention made it more complicated
    than it needed to be.)

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | Could anyone help me out with a filter i'm trying to create. I want the
    selection set to include text and mtext as well as all blocks whose names
    are dia,n,hex,sqn, and delta. I've looked in ACAD help files but haven't
    found an example that does this. I think the "and" & "or" are confusing me
    because when I do this nothing happens:
    | FilterType (0) = -4
    | FilterData (0) = "<or"
    | FilterType (1) = 0
    | FilterData (1) = "text"
    | FilterType (2) = 0
    | FilterData (2) = "mtext"
    | FilterType (3) = -4
    | FilterData (3) = "or>"
    | FilterType (4) = -4
    | FilterData (4) = "<and"
    | FilterType(5) = 0
    | FilterData(5) = "insert"
    | FilterType(6) = -4
    | FilterData(6) = "<and"
    | FilterType(7) = -4
    | FilterData(7) = "<or"
    | FilterType(8) = 2
    | FilterData(8) = "dia"
    | FilterType(9) = 2
    | FilterData(9) = "n"
    | FilterType(10) = 2
    | FilterData(10) = "hex"
    | FilterType(11) = 2
    | FilterData(11) = "sqn"
    | FilterType(12) = 2
    | FilterData(12) = "delta"
    | FilterType(13) = -4
    | FilterData(13) = "or>"
    | FilterType(14) = -4
    | FilterData(14) = "and>"
    |
    | Any ideas?
    | Thanks,
    | Matthew Corbin
     
    R. Robert Bell, Jan 6, 2004
    #2
  3. That was a huge help. I've learned something new today and am very thankful! Also I realized I forgot an AND, but that makes no difference, your way is much more efficient.Im assuming this will work with selectonscreen, I may have not made myself clear in my original post saying I wanted to filter for ALL text and Mtext, my mistake. Anyways, thanks for the help.
    Kind Regards,
    Matthew Corbin
     
    Matthew.Corbin, Jan 6, 2004
    #3

  4. Selection set filters work with all selection methods so you can either
    do this interactively or scan the entire drawing at once.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Jan 6, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.