Author Topic: Question about ssget  (Read 1535 times)

0 Members and 1 Guest are viewing this topic.

A_LOTA_NOTA

  • Guest
Question about ssget
« on: October 12, 2007, 04:36:23 PM »
Can (Setq ss (ssget "x" (??))) be used to get all the objects in a drawing by specifying just the color of the object to look for? The ones that are color "bylayer" that are the problem. I know it can be done with tblsearch but just wanted to ask about ssget!

Right now I'm doing it this way....

Code: [Select]
(setq SS1 (ssget "X")); get all entitys
(setq Lngth (sslength SS1)); list length
(setq Count 0)
(while (< Count Lngth)
(setq Ent (ssname SS1 Count)); get next item from selection set
(if (not (or (eq CLR (cdr (assoc 62 (entget Ent))))
(eq CLR (cdr (assoc 62 (tblsearch "layer" (cdr (assoc 8 (entget Ent)))))))
); end or
); end not
(progn
(ssdel Ent SS1); remove from selection set
); progn
); end if
); end while

Thanks
« Last Edit: October 12, 2007, 04:48:52 PM by A_LOTA_NOTA »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Question about ssget
« Reply #1 on: October 12, 2007, 04:53:52 PM »
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.

A_LOTA_NOTA

  • Guest
Re: Question about ssget
« Reply #2 on: October 12, 2007, 05:42:50 PM »
CAB,

 I may have missed the part of your code that I'm looking for.

I was to use something like this

(setq SS2 (ssget "x" (list (cons 62 YourColor))))

& maybe add tblsearch or something to it so that it will also select all the object on a layer with the color property.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Question about ssget
« Reply #3 on: October 12, 2007, 05:47:41 PM »
Scroll down to the second bit of code.......what you are looking for is embedded in that code..... I had a reply that showed a quick way to do this, but CAB's has every bit of that, plus some, so I decided to not post it.......