Author Topic: SSGET Filter Issue  (Read 2477 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
SSGET Filter Issue
« on: June 23, 2009, 01:12:06 PM »
Sorry for all the threads, but its one of those days... my head isn't screwed on properly today.

I have been trying to filter objects with an overridden colour, i.e. those objects with a group 62 code in their entget list.

I have tried to use an SS filter like:

Code: [Select]
(ssget "_X" '((-4 . "*") (62 . 0)))

But this just seems to pick up everything.  :-(

Any help is appreciated as always.

Lee

T.Willey

  • Needs a day job
  • Posts: 5251
Re: SSGET Filter Issue
« Reply #1 on: June 23, 2009, 01:26:33 PM »
If the object is set to bylayer, then the code is still there for the filter list, so just filter for entities where 62 != 256.

Code: [Select]
(setq ss (ssget '((-4 . "!=") (62 . 256))))
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: SSGET Filter Issue
« Reply #2 on: June 23, 2009, 01:36:50 PM »
Many thanks Tim, you have been incredibly helpful today  :wink:

I am inexperience with the -4 group codes, but could I filter for ByLayer AND ByBlock, using this?

Code: [Select]
(setq ss (ssget '((-4 . "!=") (-4 . "<OR") (62 . 256) (62 . 0) (-4 . "OR>"))))

Thanks,

Lee

T.Willey

  • Needs a day job
  • Posts: 5251
Re: SSGET Filter Issue
« Reply #3 on: June 23, 2009, 01:46:08 PM »
It's my turn to mind the store for a little while I guess.

I don't think you can do it the way you want, but you can do it this way.

Code: [Select]
(setq ss (ssget '((-4 . "<AND") (-4 . "!=") (62 . 256) (-4 . "!=") (62 . 0) (-4 . "AND>"))))

I think you can't do it the other way because you can't test the ' or ' call to be equal or not.  It is either true of false.  But this works on my simple test.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: SSGET Filter Issue
« Reply #4 on: June 23, 2009, 01:48:58 PM »
Code: [Select]
(setq ss (ssget '((-4 . "<NOT")(-4 . "<OR") (62 . 256) (62 . 0) (-4 . "OR>")(-4 . "NOT>"))))??
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.

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: SSGET Filter Issue
« Reply #5 on: June 23, 2009, 01:50:53 PM »
Thanks for the clarification Tim, but good call Alan  :lol:

T.Willey

  • Needs a day job
  • Posts: 5251
Re: SSGET Filter Issue
« Reply #6 on: June 23, 2009, 01:52:53 PM »
That's the way Alan.  Nice.   :-)

You could also test to see if the number is between 0 and 256.

Code: [Select]
(setq ss (ssget '((-4 . "<AND") (-4 . ">") (62 . 0) (-4 . "<") (62 . 256) (-4 . "AND>"))))
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: SSGET Filter Issue
« Reply #7 on: June 23, 2009, 01:53:58 PM »
Excellent guys,

I'm learning  8-)