Jump to content

How to distinguish between Ellipse and Ellipse Arc?


Ahankhah

Recommended Posts

Good one tharwat

I 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 .:lol:

 

So no chance to forget them anymore . :lol:

 

Cheers . :beer:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

:)

Link to comment
Share on other sites

Not quite.

 

:lol: 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...