It makes no sense!! what's the selection set problem

It makes no sense!! what's the selection set problem

Anonymous
Not applicable
964 Views
6 Replies
Message 1 of 7

It makes no sense!! what's the selection set problem

Anonymous
Not applicable

I would really like to understand why this works in drawing:

 

(setq tst (ssget "_CP" (list '(1.0 1.0 0.0) '(3.0 1.0 0.0) '(5.0 2.0 0.0) '(2.0 4.0 0.0)) ))
(sssetfirst nil tst)

 

and this does not:

 

(setq sel (ssget "_CP" (list '(21.8654 16.9251 0.0) '(21.8654 10.9251 0.0) '(21.8654 16.9251 0.0) '(21.8654 16.9251 0.0))))
  (sssetfirst nil sel)

 

 

 

Here a very simple function,
already checked the zoom continues with the same problem.

 

(defun c:TEST ( )
  (setq obj (vlax-ename->vla-object (car (entsel)))
        bpt (vlax-get obj 'insertionpoint)
        rot (vlax-get obj 'rotation)
  )
  ;; fast calculation just test !!
  (setq pnt1 (polar bpt  (+ rot  (* 0.0 pi))  2.0))
  (setq pnt2 (polar bpt  (+ rot  (* 1.0 pi))  2.0))
  (setq X_   (polar bpt  (+ rot  (* 1.0 pi)) -2.0))  
  (setq pnt3 (polar X_   (+ rot  (* 0.5 pi))  6.0))
  (setq pnt4 (polar pnt2 (+ rot  (* 0.5 pi))  6.0))
  ;;
  (setq sel (ssget "_CP" (list pnt1 pnt2 pnt3 pnt4)))
  ;(setq sel (ssget "_CP" (list '(21.8654 16.9251 0.0) '(21.8654 10.9251 0.0) '(21.8654 16.9251 0.0) '(21.8654 16.9251 0.0))))
  (sssetfirst nil sel)
)

 

 

0 Likes
Accepted solutions (3)
965 Views
6 Replies
Replies (6)
Message 2 of 7

cadffm
Consultant
Consultant

If there is no typo ( can not see one on my small mobile)

 

It works the same way as the first code.

Do you know that ACADs object selection is dependent on the current view?

 

Not all methods, all group single ... are not

But windows, cross, crosspolygon..

That is a general thing, nothing to do with lisp, not specially.

 

Zoom this area of coordinates big as possible, try it again.

 

 

Hopeful i did not missed the case.

 

EDIT: I didn't saw the DWG & i can not test now.

If i missmatched the case: Sorry for it.

Sebastian

0 Likes
Message 3 of 7

Anonymous
Not applicable

already tried, zoom is not the problem. 

0 Likes
Message 4 of 7

cadffm
Consultant
Consultant
Accepted solution

Please check your coordinates, this is what make not sense.

3 of 4 point are the same.

CrossPoly can not cross themselve.

 

 

F*ck, this mobile is too small for these things, lol.

Sebastian

Message 5 of 7

pbejse
Mentor
Mentor
Accepted solution

@cadffm wrote:

Please check your coordinates, this is what make not sense.

3 of 4 point are the same.


 

That is same thing i notice just by looking at the points, was thinking it could be a typo by the OP? or maybe not. 🙂

Was actually waiting for the OP to notice it after posting the question.

wait for it.... 

 

@Anonymous 

As intended?

(setq sel (ssget "_CP" (list '(21.8654 16.9251 0.0) '(21.8654 10.9251 0.0) '(17.8654 10.9251 0.0) '(17.8654 16.9251 0.0))))
  (sssetfirst nil sel)

 

Message 6 of 7

hak_vz
Advisor
Advisor
Accepted solution

@Anonymous   As @pbejse  and @cadffm  stated before me problem is with multiple equal points. As with many algorithms here we have zero length edge of clipping polygon.  When we for example join lines to polyline problems are zero length lines. It is always a good practice to create set of unique points before including in selection set or other operations.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 7 of 7

Anonymous
Not applicable

I believe that a lot of attention was lacking when I tried it so it worked !!!

(setq sel (ssget "_CP" (list pnt3 pnt1 pnt2 pnt4)))

Thank you very much for your willingness.