Ahankhah Posted September 21, 2011 Share Posted September 21, 2011 Hi CADmates, how is it possible to recognize an ellipse object is closed (i.e. full ellipse) or open (i.e ellipse arc)? Any reply appreciated. Quote Link to comment Share on other sites More sharing options...
pBe Posted September 21, 2011 Share Posted September 21, 2011 (if (= StartAngle 0) (Closed/FullEllipse) (Open/EllipseArc) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 21, 2011 Share Posted September 21, 2011 My approach ... (vlax-curve-IsClosed (car (entsel "\n Select Ellipse :"))) If Yes T . nil otherwise Quote Link to comment Share on other sites More sharing options...
pBe Posted September 21, 2011 Share Posted September 21, 2011 Good one tharwat I didint know that one Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 21, 2011 Share Posted September 21, 2011 Good one tharwatI didint know that one Thank you pBe , I knew these functions which are start with vlax-curve-****** when I was fighting with Polylines to know how to handle them . So no chance to forget them anymore . Cheers . Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted September 21, 2011 Author Share Posted September 21, 2011 pBe and Tharwat, thank you very much for your help. Meanwhile I researched inside Ellipse and Ellipse Arc lists. I found a dxf code inside them which shows whether ellipse is closed or not. The advantage of the following code is filtering them automatically or on the fly (when selecting objects). (setq ellipses (ssget "X" (list (cons -4 "<AND") (cons 0 "ELLIPSE") (cons 41 0) (cons -4 "AND>") ) ) ) (setq ellipsearcs (ssget "X" (list (cons -4 "<AND") (cons 0 "ELLIPSE") (cons -4 "<NOT") (cons 41 0) (cons -4 "NOT>") (cons -4 "AND>") ) ) ) Quote Link to comment Share on other sites More sharing options...
pBe Posted September 21, 2011 Share Posted September 21, 2011 That is correct though (ssget "X" '((0 . "ELLIPSE") (41 . 0))) would be enough for filter list I was too engrossed with vlaobjects to think about a simple syntax with vanilla Good stuff Ahankhah Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted September 21, 2011 Author Share Posted September 21, 2011 pBe, thanks a lot. everything you explain is very clear, unless you name pBe Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 21, 2011 Share Posted September 21, 2011 (if (= StartAngle 0) (Closed/FullEllipse) (Open/EllipseArc) ) Not quite. Consider: (entmakex (list (cons 0 "ELLIPSE") (cons 100 "AcDbEntity") (cons 100 "AcDbEllipse") (list 10 0.0 0.0 0.0) (list 11 1.0 0.0 0.0) (cons 40 0.5) (cons 41 0.0) (cons 42 pi) ) ) Meanwhile I researched inside Ellipse and Ellipse Arc lists. I found a dxf code inside them which shows whether ellipse is closed or not. (setq ellipses ... ) (setq ellipsearcs ... ) This won't work for the above counter example, consider the following instead: (defun c:ellipses nil (sssetfirst nil (ssget "_X" (list (cons 0 "ELLIPSE") (cons 41 0.0) (cons 42 (* 2 pi)) ) ) ) ) (defun c:ellipsearcs nil (sssetfirst nil (ssget "_X" (list (cons 0 "ELLIPSE") (cons -4 "<OR") (cons -4 "<>") (cons 41 0.0) (cons -4 "<>") (cons 42 (* 2 pi)) (cons -4 "OR>") ) ) ) ) Quote Link to comment Share on other sites More sharing options...
pBe Posted September 21, 2011 Share Posted September 21, 2011 Not quite. I realize that right after i posted. Consider: consider the following instead: (defun c:ellipses nil ...... (cons 42 (* 2 pi)) ...... ) ) ) ) Really? Guess i ddnt do a thorough test Thank you for the info. Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted September 21, 2011 Author Share Posted September 21, 2011 This won't work for the above counter example, consider the following instead... Lee, I am surprised of your excellent look and observing all side effects of any code:o. Again and again and again..., thank you very much:D. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 21, 2011 Share Posted September 21, 2011 Lee, I am surprised of your excellent look and observing all side effects of any code:o. A side effect I suppose from studying a maths degree involving countless proofs... You're welcome Ahankhah Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.