Author Topic: help ssget + filter  (Read 2267 times)

0 Members and 1 Guest are viewing this topic.

TopoWAR

  • Newt
  • Posts: 135
help ssget + filter
« on: January 06, 2013, 02:23:44 PM »
Hi all, I'm using xdata in some objects, eg circles.
I work the following method:
Code: [Select]
(ssget (list (cons -4 "<OR")
     (list -3 (list "topo1"))
     (list -3 (list "topo2"))
     (cons -4 "OR>")))
but I want to add the application name in a variable
eg: (setq L '("topo1" "topo2" "topo3" "topo10" "etc...")

I just want to store the names of the applications in a variable and add that variable to ssget filter.

as I do, and I can take hours, please help
Thanks for help

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: help ssget + filter
« Reply #1 on: January 06, 2013, 02:55:48 PM »
Hi,

you can use more than one reg app name separated with commas:
Code - Auto/Visual Lisp: [Select]
  1. (ssget '((-3 ("topo1,topo2"))))
you can use wildcard patterns too:
Code - Auto/Visual Lisp: [Select]
  1. (ssget '((-3 ("topo*"))))
Speaking English as a French Frog

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: help ssget + filter
« Reply #2 on: January 06, 2013, 03:00:27 PM »
If you have an arbitrary list of AppIDs, maybe something like:

Code - Auto/Visual Lisp: [Select]
  1.     (append
  2.        '((-4 . "<OR"))
  3.         (mapcar '(lambda ( x ) (list -3 (list x))) <list-of-AppIDs>)
  4.        '((-4 . "OR>"))
  5.     )
  6. )

Or,
Code - Auto/Visual Lisp: [Select]
  1.     (list
  2.         (list -3
  3.             (list
  4.                 (substr
  5.                     (apply 'strcat
  6.                         (mapcar '(lambda ( x ) (strcat "," x)) <list-of-AppIDs>)
  7.                     )
  8.                     2
  9.                 )
  10.             )
  11.         )
  12.     )
  13. )

TopoWAR

  • Newt
  • Posts: 135
Re: help ssget + filter
« Reply #3 on: January 06, 2013, 03:02:00 PM »
that simple, you do not know is how they do not see, because teachers.
Thanks for help

xiaxiang

  • Guest
Re: help ssget + filter
« Reply #4 on: January 13, 2013, 08:08:08 PM »
If you have an arbitrary list of AppIDs, maybe something like:

Code - Auto/Visual Lisp: [Select]
  1.     (append
  2.        '((-4 . "<OR"))
  3.         (mapcar '(lambda ( x ) (list -3 (list x))) <list-of-AppIDs>)
  4.        '((-4 . "OR>"))
  5.     )
  6. )

Hi,Lee
Why was the codes  changed in a row when I copied them to notepad++ or vlide?
As follow
Code: [Select]
(ssget    (append       '((-4 . "<OR"))        (mapcar '(lambda ( x ) (list -3 (list x))) <list-of-AppIDs>)       '((-4 . "OR>"))    ))
The code indentation has been lost.
I do not know whether my express is clear .
Sorry for that :lol:

xiaxiang

  • Guest
Re: help ssget + filter
« Reply #5 on: January 13, 2013, 08:24:46 PM »
Aha,I know that the matter is caused by IE kernel explorer.
If using some explorer with Chrome kernel ,it's no problem :ugly:
I Do not know whether the forum can resolve this problem or not in the future.