SSGET with wildcard for color

Discussion in 'AutoCAD' started by Tom Quok, Feb 2, 2005.

  1. Tom Quok

    Tom Quok Guest

    I'm trying to create a selection set with "ssget" that will exclude all
    objects that are inputted "bycolor" with the following :

    '((-4 . "<NOT") (62 . *) (-4 . "NOT>"))

    This does not seem to work. Any suggestion would be welcome

    Tom
     
    Tom Quok, Feb 2, 2005
    #1
  2. Tom Quok

    BillZ Guest

    (ssget "X" '((-4 . "<OR")(62 . 0)(62 . 256)(-4 . "OR>")))

    Bill
     
    BillZ, Feb 2, 2005
    #2
  3. Tom Quok

    James Allen Guest

    This will still miss anything that is bylayer by default; i.e. absent group
    code. Haven't tried it but perhaps this would work:
    ((-4 . "<AND")
    (-4 . ">")
    (62 . 0)
    (-4 . "<")
    (62 . 256)
    (-4 . "AND>")
    )
     
    James Allen, Feb 2, 2005
    #3
  4. Tom Quok

    Paul Turvill Guest

    No it won't. The BYLAYER property is inferred by LISP whether the group is
    physically present or not.
    ___
     
    Paul Turvill, Feb 2, 2005
    #4
  5. Tom Quok

    Tom Quok Guest

    using "256" seems to work. Just wondering why the "*" wildcard does not.
    What If I wanted to filter just color # 10 thru 19. How would I do that ?
    ( since using "1*" wouldn't work )

    Tom
     
    Tom Quok, Feb 2, 2005
    #5
  6. Tom Quok

    Jeff Mishler Guest

    Ah, man....I see Paul beat me to it....oh well, here's a demonstration
    anyway....

    James,
    Use of (62 . 256) in a selection set filter works on all entities, whether
    the (62 .256) shows in the (entget) or not. This is from a small drawing
    that I have open that has all entities as "bylayer":

    Command: (setq ss (ssget "x" '((62 . 256))))
    <Selection set: 17>

    Command: (setq ss2 (ssget "x"))
    <Selection set: 19>

    Command: (sslength ss)
    346

    Command: (sslength ss2)
    346

    And after changing 1 to red:
    Command: (setq ss (ssget "x" '((62 . 256))))
    <Selection set: 1e>

    Command: (setq ss2 (ssget "x"))
    <Selection set: 20>

    Command: (sslength ss)
    345

    Command: (sslength ss2)
    346
     
    Jeff Mishler, Feb 2, 2005
    #6
  7. Tom Quok

    James Allen Guest

    Huh! Well that's easier. I thought I had trouble with that before, but
    maybe I just imagined it. Thanks for the correction Paul.

    James
     
    James Allen, Feb 2, 2005
    #7
  8. Tom Quok

    Jeff Mishler Guest

    (setq ss (ssget "x" '((-4 . ">=")(62 . 10)(-4 . "<=")(62 . 19))))
     
    Jeff Mishler, Feb 2, 2005
    #8
  9. Tom Quok

    Paul Turvill Guest

    (ssget "x" '((-4 . "<AND")(-4 . ">=")(62 . 10)(-4 . "<=")(62 . 19)(-4 .
    "AND>")))
    ___
     
    Paul Turvill, Feb 2, 2005
    #9
  10. Tom Quok

    James Allen Guest

    Now that one I think would need something like what I posted: (untested
    still...)
    ((-4 . "<AND")
    (-4 . ">=")
    (62 . 10)
    (-4 . "<=")
    (62 . 19)
    (-4 . "AND>")
    )

    James
     
    James Allen, Feb 2, 2005
    #10
  11. Tom Quok

    Paul Turvill Guest

    Ah, yes. You're right the "AND" is always implied.
    ___
     
    Paul Turvill, Feb 2, 2005
    #11
  12. Tom Quok

    James Allen Guest

    Yeah, I see it now... checked it myself after I saw his post. Just not sure
    why I had decided it wouldn't work... Oh well. I know better now. Thanks
    Jeff.

    James


    [/QUOTE]
     
    James Allen, Feb 2, 2005
    #12
  13. Tom Quok

    James Allen Guest

    Okay, I got it too. "And is implied." Thanks again all.

    james
     
    James Allen, Feb 2, 2005
    #13
  14. Tom Quok

    Tom Smith Guest

    using "256" seems to work. Just wondering why the "*" wildcard does not.
    I believe wildcards apply to strings, not numbers, so you'd need a
    relational test.

    (ssget '((-4 . ">=") (62 . 10) (-4 . "<=") (62 . 19)))
     
    Tom Smith, Feb 2, 2005
    #14
  15. Tom Quok

    BillZ Guest

    This will still miss anything that is bylayer by default; i.e. absent group
    code.<<<

    Not according to my tests in R2K5....

    Bill
     
    BillZ, Feb 3, 2005
    #15
  16. Tom Quok

    James Allen Guest

    You're right. My apologies.

    James


     
    James Allen, Feb 3, 2005
    #16
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.