Thread: How to distinguish between Ellipse and Ellipse Arc?

1. How to distinguish between Ellipse and Ellipse Arc?

Registered forum members do not see this ad.

how is it possible to recognize an ellipse object is closed (i.e. full ellipse) or open (i.e ellipse arc)?

2. Code:
```(if
(= StartAngle 0)
(Closed/FullEllipse)
(Open/EllipseArc)
)```

3. My approach ...

Code:
`(vlax-curve-IsClosed (car (entsel "\n Select Ellipse :")))`
If Yes T . nil otherwise

4. Good one tharwat
I didint know that one

5. Originally Posted by pBe
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 .

So no chance to forget them anymore .

Cheers .

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

Code:
```(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>")
)
)
)```

7. That is correct though

Code:
` (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

8. pBe,
thanks a lot.
everything you explain is very clear, unless you name pBe

9. Originally Posted by pBe
Code:
```(if
(= StartAngle 0)
(Closed/FullEllipse)
(Open/EllipseArc)
)```
Not quite.

Consider:

Code:
```(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)
)
)```

Originally Posted by Ahankhah
Meanwhile I researched inside Ellipse and Ellipse Arc lists. I found a dxf code inside them which shows whether ellipse is closed or not.
Code:
```(setq ellipses
...
)

(setq ellipsearcs
...
)```
This won't work for the above counter example, consider the following instead:

Code:
```(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>")
)
)
)
)```

10. Registered forum members do not see this ad.

Originally Posted by Lee Mac
Not quite.
I realize that right after i posted.

Originally Posted by Lee Mac
Consider:

Code:
```(defun c:ellipses nil
......                (cons 42 (* 2 pi)) ......
)
)
)
)```
Really? Guess i ddnt do a thorough test

Thank you for the info.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts