wcmatch question

Discussion in 'AutoCAD' started by mark, Aug 5, 2004.

  1. mark

    mark Guest

    hello all,

    i have layers names starting w/ characters XXX
    and layer names starting w/ characters YYY

    how do i select all objects on layers not matching
    layer names XXX* or YYY*

    the following code is not doing the job

    (setq ss (ssget "X" (list (cons 8 "~XXX*,~YYY*")))

    although the following works,

    (setq ss (ssget "X" (list (cons 8 "~XXX*")(cons 8 "~YYY*")))

    but i would like it to do it in one shot.

    similarly if i want to purge all layers other than
    XXX* and YYY* the following is not working either

    (command "PURGE" "LA" "~XXX*,YYY*" "N")
    (command "PURGE" "LA" "~XXX*,~YYY*" "N") nor

    help will be greatly appreciated
    thanks
     
    mark, Aug 5, 2004
    #1
  2. How about something like this. (briefly tested)

    (ssget "x" '((8 . "[~xxx],[~yyy]")))
     
    Jason Piercey, Aug 5, 2004
    #2
  3. mark

    mark Guest

    Jason,
    thanks for giving it a shot, but
    i do not think it is the same,
    and i do not think it does the job
    thanks again
    mark

     
    mark, Aug 5, 2004
    #3
  4. mark

    Jürg Menzi Guest

    Hi Mark
    Results in a 'Or' condition - means one of both is always true, therefore it
    can't work. Use:
    '((-4 . "<AND") (8 . "~XXX*") (8 . "~YYY*") (-4 . "AND>"))

    Cheers
     
    Jürg Menzi, Aug 5, 2004
    #4
  5. mark

    Jürg Menzi Guest

    Ahem, 'And' is default...>:-(

    '((8 . "~XXX*") (8 . "~YYY*"))

    is enough...

    Cheers
     
    Jürg Menzi, Aug 5, 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.