Selection set of everything except...

Discussion in 'AutoCAD' started by Matt W, Jun 9, 2004.

  1. Matt W

    Matt W Guest

    Is it possible to create a selection set of EVERYTHING except for, let's
    say, text, lines and xrefs regardless of layer??


    I know you can create selection sets of multpiple objects, but I've never
    seen any code for everything except for a few items.
    Is it even possible?? If so, how??

    Thanks in advance!
     
    Matt W, Jun 9, 2004
    #1
  2. Matt W

    Paul Turvill Guest

    (setq ss (ssget "x" '((-4 . "<NOT")(0 . "TEXT,LINE,INSERT")(-4 . "NOT>"))))
    will select everything but text, lines, and block insertions (both regular
    blocks and XREFs.

    Since XREFs are a special kind of INSERT, you'll have to add a little more
    code to check if bit 2 (value 4) of DXF code 70 is set for each block
    definition in the Block Table.
    ___
     
    Paul Turvill, Jun 10, 2004
    #2
  3. Matt W

    Paul Turvill Guest

    Oops ... sorry about the LISP ... forgot I was lurking in the VBA group.

    "NOT>"))))
     
    Paul Turvill, Jun 10, 2004
    #3
  4. you can use the "~" symbol. Just like at the command line c: -la "f" ~*.hid
    freezes all layers except the ones that end in hid. was cool before
    expresstools. ha.

    codes(0) = 0: values(0) = "~" & "line,text,"
    works for on layers should work on other objects

    hope it helps.

    Paul
     
    Paul Richardson, Jun 10, 2004
    #4
  5. Matt,

    This seems to work fine.

    Paul

    Public Sub AllBut()
    Dim ssTest As AcadSelectionSet
    Dim gpCode() As Integer
    Dim gpData As Variant

    With ThisDrawing.Utility
    Set ssTest = ThisDrawing.SelectionSets.Add("ssAllBut")

    ReDim gpCode(2): ReDim gpData(2)
    gpCode(0) = 0: gpData(0) = "~line"
    gpCode(1) = 0: gpData(1) = "~circle"
    gpCode(2) = 0: gpData(2) = "~text"

    ssTest.Select acSelectionSetAll, , , gpCode, gpData
    End With
    End Sub
     
    Paul Richardson, Jun 11, 2004
    #5
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.