Author Topic: ssget filter errors  (Read 3815 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10388
Re: ssget filter errors
« Reply #15 on: October 02, 2005, 12:44:14 PM »
How about this?
Code: [Select]
(setq ss
       (vl-catch-all-apply 'ssdel
                           (list (handent "345AD7")
                                 (ssget '((0 . "INSERT") (66 . 1) (2 . "R-NAME")))
                           )
       )
)
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.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: ssget filter errors
« Reply #16 on: October 02, 2005, 02:32:50 PM »
WHd...

what you realy need to do ?
« Last Edit: October 02, 2005, 02:47:45 PM by Andrea »
Keep smile...

MP

  • Seagull
  • Posts: 17685
  • Have thousands of dwgs to process? Contact me.
Re: ssget filter errors
« Reply #17 on: October 02, 2005, 03:48:03 PM »
I like the new indenting style Alan, very easy to discern the parentage.

:-o
Engineering Technologist CAD Specialist Programmer Analyst
Design Drafting Document Control Automation.
cadanalyst@fastmail.com https://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: ssget filter errors
« Reply #18 on: October 02, 2005, 03:53:33 PM »
hehehe ..
yeah, nothing worse than illegitimate code.

Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

MP

  • Seagull
  • Posts: 17685
  • Have thousands of dwgs to process? Contact me.
Re: ssget filter errors
« Reply #19 on: October 02, 2005, 03:54:15 PM »
 :-D
Engineering Technologist CAD Specialist Programmer Analyst
Design Drafting Document Control Automation.
cadanalyst@fastmail.com https://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17685
  • Have thousands of dwgs to process? Contact me.
Re: ssget filter errors
« Reply #20 on: October 02, 2005, 04:32:16 PM »
Humour aside, I don't think that's a good approach Alan, and here's why --

If we assume we have a drawing that has valid entities in it you'll agree, this should retrieve all the entities correct?

Code: [Select]
(ssget "x")
Now let's filter it using your code and supply a bogus handle to the affore mentioned code --

Code: [Select]
(setq ss
    (vl-catch-all-apply 'ssdel
        (list (handent "BOGUS")
            (ssget "x")
        )
    )
)

Instead of a selection set containing all the entities being assigned to variable ss we get a bound error object. Not so good me thinks.

If you're bent on using vl-catch-all-apply here's an interesting alternate (of many) just for fun --

Code: [Select]
(vl-catch-all-apply
   '(lambda ( )
        (setq ss
            (ssdel (handent "BOGUS")
                (setq ss
                    (ssget "x")
                )
            )
        )   
    )
)

If the supplied handle is valid AND the corresponding ename a member of the inner most ss it will be removed and the resulting (slimmed down) selection set assigned to ss, otherwise the original selection set will remain assigned to ss. The entire code snip does return an error object which we have chosen to discard in this case.

:)
Engineering Technologist CAD Specialist Programmer Analyst
Design Drafting Document Control Automation.
cadanalyst@fastmail.com https://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10388
Re: ssget filter errors
« Reply #21 on: October 02, 2005, 06:12:59 PM »
I see, I guess I would drop back to this.
Code: [Select]
(setq ss (ssget "x"))
(and (handent "BOGUS")
     (ssdel (handent "BOGUS") ss))
I wasn't married to that code just tried to figure a way to catch the error. :-)
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.

MP

  • Seagull
  • Posts: 17685
  • Have thousands of dwgs to process? Contact me.
Re: ssget filter errors
« Reply #22 on: October 02, 2005, 07:07:50 PM »
Yep.

Engineering Technologist CAD Specialist Programmer Analyst
Design Drafting Document Control Automation.
cadanalyst@fastmail.com https://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: ssget filter errors
« Reply #23 on: October 03, 2005, 09:14:35 AM »
WHd...

what you realy need to do ?
What I am doing is selecting a block with attributes as a reference block.  I am then asking the user to select more of the same block; however I wanted the ssget filter to remove the original block if it was selected in the selection set.  I have it set up right now that after it makes the selection set and returns all the entities I use vl-remove to delete the original referenced block.  If the block is in the set then it is deleted or if the block is not in the set then the set is passed back with no errors to worry about.

I just was looking for a way to remove the block using the ssget function. :-)

Thanks for all the help you guys have given and ofcourse the great discussion I started. :mrgreen: