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)
)
Solved! Go to Solution.
Solved by hak_vz. Go to Solution.
Solved by pbejse. Go to Solution.
Solved by cadffm. Go to Solution.
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
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
@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)
@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
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.
Can't find what you're looking for? Ask the community or share your knowledge.