Author Topic: working with (-4 "<not")  (Read 2479 times)

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Guest
working with (-4 "<not")
« on: March 29, 2006, 05:15:16 AM »
Hello everybody
I got used a bit to work with that kind of filters for my ss. But I'm not sure about the use of the "<not". In this example i want to exclude layer "WL$ and blocks with the name "LDT" and "LDS". But somehow it doesn't work. So i see i don't understanfd the thing in it whole working.

Code: [Select]
(SETQ FLT '(
(-4 . "<AND")
(-4 . "<NOT")
            (8 . "WL$*")
            (2 . "LDS")
            (2 . "LDT")
            (-4 . "NOT>")
            (-4 . "<OR")
                     (8 . "WL*");;;                     (-3 . "STABICAD")
(8 . "EL*")
                     (-4 . "OR>")
            (-4 . "AND>")
                     )
               )
   
(setq ssb (ssget "c" pt2 pt1 flt))

Thanks in Advance,

 Bernd

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: working with (-4 "<not")
« Reply #1 on: March 29, 2006, 05:48:52 AM »
(setq flt '((8 . "WL[~$]*,EL*") (2 . "~LD[ST]*")))
(setq ssb (ssget "c" pt2 pt1 flt))

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: working with (-4 "<not")
« Reply #2 on: March 29, 2006, 05:58:39 AM »
>Bernd
Read in help about WCMATCH function...

Amsterdammed

  • Guest
Re: working with (-4 "<not")
« Reply #3 on: March 29, 2006, 06:30:08 AM »
Evgeny,

I obviosly don't get it (busy day or just to stupid). I need all the Block names and the "U*" as valid, exept thoose two.

Bernd

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: working with (-4 "<not")
« Reply #4 on: March 29, 2006, 06:47:05 AM »
Evgeny,

I obviosly don't get it (busy day or just to stupid). I need all the Block names and the "U*" as valid, exept thoose two.

Bernd
Probably, I have misunderstood you... :-(

Code: [Select]
(wcmatch "U*" "~LD[ST]*") ; => T
(wcmatch "AAA" "~LD[ST]*") ; => T
(wcmatch "LD" "~LD[ST]*") ; => T
(wcmatch "LDA" "~LD[ST]*") ; => T
(wcmatch "LDS" "~LD[ST]*") ; => NIL
(wcmatch "LDSA" "~LD[ST]*") ; => NIL
(wcmatch "LDT" "~LD[ST]*") ; => NIL
(wcmatch "LDTA" "~LD[ST]*") ; => NIL

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: working with (-4 "<not")
« Reply #5 on: March 29, 2006, 09:34:52 AM »
Looks like ElpanovEvgeniy example would do the job. There is a lot of untapped power in the WCMATCH characters.

Perhaps this will work for you.

Code: [Select]
(setq flt '((-4 . "<NOT")    ; ignore if the following is true
               (-4 . "<AND")   ; all that follow must be true
                 (8 . "WL$*")    ; layer WL$ plus anything other characters
                 (0 . "INSERT")  ; blocks only
                 (2 . "LDS,LDT") ; only names LDS or LDT
              (-4 . "AND>")
            (-4 . "NOT>")))

« Last Edit: March 29, 2006, 09:38:05 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: working with (-4 "<not")
« Reply #6 on: March 29, 2006, 10:07:39 AM »
Completely the working code.
Code: [Select]
(setq flt '((8 . "WL[~$]*,EL*") (2 . "~LD[ST]*")))
Works equally
Code: [Select]
(SETQ FLT
'((-4 . "<AND")
    (-4 . "<NOT")
      (8 . "WL$*")
      (2 . "LDS")
      (2 . "LDT")
    (-4 . "NOT>")
    (-4 . "<OR")
      (8 . "WL*")
      (8 . "EL*")
    (-4 . "OR>")
(-4 . "AND>")
))

Amsterdammed

  • Guest
Re: working with (-4 "<not")
« Reply #7 on: March 30, 2006, 01:14:08 AM »
Thanks both of you,

since i gad not my brightest day yesterday I ended with something looking like CAB"s approach, was easier to understand for me. The WCmatch is indeed powerfull, i use it a lot but only in the simple way. I have to get familiar with the special symbols.

Thanks, Bernd