Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
761 Views, 6 Replies

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

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)
)

 

 

Tags (1)
6 REPLIES 6
Message 2 of 7
cadffm
in reply to: Anonymous

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

EESignature

Message 3 of 7
Anonymous
in reply to: cadffm

already tried, zoom is not the problem. 

Message 4 of 7
cadffm
in reply to: Anonymous

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

EESignature

Message 5 of 7
pbejse
in reply to: cadffm


@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
in reply to: Anonymous

@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
in reply to: pbejse

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.

Post to forums  

Forma Design Contest


AutoCAD Beta