Deleting 2 (or more) Selections Sets

Deleting 2 (or more) Selections Sets

Anonymous
Not applicable
706 Views
2 Replies
Message 1 of 3

Deleting 2 (or more) Selections Sets

Anonymous
Not applicable

Hi Everyone!

 

I'm trying to create a lisp that will delete Two Different Selection Sets that are set by 4 points (creating 2 rectangles)

 

(defun c:abrichmond ()
(setq
pt1 '(195.04094339 725.61441843 0.0)
pt2 '(1150.04094339 1065.61441843 0.0)
pt3 '(803.48705661 727.73346049 0.0)
pt4 '(497.48705661 1065.61441843 0.0)
)
(setq ss1 (ssget "W" pt1 pt2))
(setq ss2 (ssget "W" pt3 pt4))
(COMMAND "ERASE" ss1 "")
(COMMAND "ERASE" ss2 "")
)

 

The command only seems to erase the initial selection set (ss1) but does not erase the second selection set (ss2).

 

Any Suggestions would be much appreciated!

 

Thanks in Advanced,

 

Ben

0 Likes
707 Views
2 Replies
Replies (2)
Message 2 of 3

Moshe-A
Mentor
Mentor

@Anonymous wrote:

Hi Everyone!

 

I'm trying to create a lisp that will delete Two Different Selection Sets that are set by 4 points (creating 2 rectangles)

 

(defun c:abrichmond ()
(setq
pt1 '(195.04094339 725.61441843 0.0)
pt2 '(1150.04094339 1065.61441843 0.0)
pt3 '(803.48705661 727.73346049 0.0)
pt4 '(497.48705661 1065.61441843 0.0)
)
(setq ss1 (ssget "W" pt1 pt2))
(setq ss2 (ssget "W" pt3 pt4))
(COMMAND "ERASE" ss1 "")
(COMMAND "ERASE" ss2 "")
)

 

The command only seems to erase the initial selection set (ss1) but does not erase the second selection set (ss2).

 

Any Suggestions would be much appreciated!

 

Thanks in Advanced,

 

Ben


check this:

 

(if (setq ss1 (ssget "W" pt1 pt2))

 (COMMAND "ERASE" ss1 "")

)


(if (setq ss2 (ssget "W" pt3 pt4))

 (COMMAND "ERASE" ss2 "")

)

 

Moshe

0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant

Wow -- 8 decimal places out of multi-hundreds to over 1000 units!

 

Your first window [from 195,726 to 1150,1066] completely contains  your second window [from 803,728 to 497,1066], so anything found to be in ss2 will also be in ss1, and will therefore have been Erased already by the time the second Erase command comes along.  Are those numbers all correct?

Kent Cooper, AIA
0 Likes