filtering selection set

Discussion in 'AutoCAD' started by villaco, Aug 5, 2003.

  1. villaco

    villaco Guest

    Hello everybody,
    I'm trying to make a selection set of all items on the screen but can I use a filter with the mode acSelectionSetAll?
    I'm trying something like this:
    Dim intgrpcode(0) As Integer
    Dim varcodevalue(0) As Variant
    Dim selnodos As AcadSelectionSet
    intgrpcode = 8
    varcodevalue = "NODE" 'I want to filter the layer "NODE"
    Set selnodos = ThisDrawing.SelectionSets.Add("nodes")
    selnodos.Select acSelectionSetAll, , , intgrpcode, varcodevalue

    But i get an error in this last command, it's imposible select all items on the screen using a filter?
    Thanx
    Villaco
     
    villaco, Aug 5, 2003
    #1
  2. You had the data assignment to the arrays messed up:

    Public Sub Test()
    Dim intgrpcode(0) As Integer
    Dim varcodevalue(0) As Variant
    Dim selnodos As AcadSelectionSet
    intgrpcode(0) = 8 ' <- Note change
    varcodevalue(0) = "NODE" ' <- Note change
    Set selnodos = ThisDrawing.SelectionSets.Add("nodes")
    selnodos.Select acSelectionSetAll, , , intgrpcode, varcodevalue
    End Sub

    Also, your code does not handle the named selection set already existing.
    You could elect to use the PickfirstSelectionSet:

    Dim ss As AcadSelectionSet
    Set ss = ThisDrawing.PickfirstSelectionSet

    Or use some of the selection set functions commonly posted (or located on
    our website).


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


    | Hello everybody,
    | I'm trying to make a selection set of all items on the screen but can I
    use a filter with the mode acSelectionSetAll?
    | I'm trying something like this:
    | Dim intgrpcode(0) As Integer
    | Dim varcodevalue(0) As Variant
    | Dim selnodos As AcadSelectionSet
    | intgrpcode = 8
    | varcodevalue = "NODE" 'I want to filter the layer "NODE"
    | Set selnodos = ThisDrawing.SelectionSets.Add("nodes")
    | selnodos.Select acSelectionSetAll, , , intgrpcode, varcodevalue
    | But i get an error in this last command, it's imposible select all items
    on the screen using a filter?
    | Thanx
    | Villaco
    |
     
    R. Robert Bell, Aug 5, 2003
    #2
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.