AutoCAD 2004/2005/2006

Reply
*Tim Mathis
Message 1 of 6 (414 Views)

converting ellipse to arc?

414 Views, 5 Replies
05-24-2005 07:54 AM
Can anyone help with this? I have a drawing and another firm we work for
uses a program that can't read ellipses. I don't know of a way to convert
them...Thanks
Distinguished Contributor
dviator
Posts: 1,285
Registered: ‎12-11-2003
Message 2 of 6 (414 Views)

Re: converting ellipse to arc?

05-24-2005 08:40 AM in reply to: *Tim Mathis
you have a few options:

- redraw the ellipses as polylines (look at the PELLIPSE variable)
- save the drawing (or maybe just the ellipses) as an R12 DXF (it will convert the ellipses to polylines)
- search the web (or these discussion groups) for a LISP routine to do it for you (i seem to remember one called EL2PL.lsp or something similar)
Distinguished Contributor
JDMATHER
Posts: 4,994
Registered: ‎12-12-2003
Message 3 of 6 (414 Views)

Re: converting ellipse to arc?

05-24-2005 12:05 PM in reply to: *Tim Mathis
Used to teach how to draw a 4 arc ellipse approximation on the drawing board. You should have an old drafting book lying around somewhere for reference.
*Shaun
Message 4 of 6 (414 Views)

Re: converting ellipse to arc?

05-26-2005 05:28 AM in reply to: *Tim Mathis
Try this Tim

;Tip1539A: EL2PL.LSP Ellipse to Pline (c)1999, Oleg Khenson

(defun C:EL2PL (/ A CEN CLA CMD DIS EN END_P1
END_P2 ENT I K LA LT M MINOR%
NM OLDERR OS PELMODE SS
)
(defun DXF (CODE ELIST) (cdr (assoc CODE ELIST)))
(defun EL2PL_ERR (S)
(if (/= S "Function cancelled")
(princ (strcat "\nError: " S))
)
(setvar "CMDECHO" CMD)
(if OS
(setvar "OSMODE" OS)
)
(setq *ERROR* OLDERR
OLDERR NIL
)
(princ)
)
(setq OLDERR *ERROR*
*ERROR* EL2PL_ERR
)
(setq CMD (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(princ "\nSelect Ellipses to be converted to PLines: ")
(setq SS (ssget '((0 . "ELLIPSE"))))
(command ".UNDO" "G")
(if SS
(progn
(setq OS (getvar "OSMODE"))
(setvar "OSMODE" 0)
(setq I 0
K 0
M 0
)
(repeat (sslength SS) ; for each entity from SS
(setq A (entget (setq NM (ssname SS I)
ENT NM
)
)
LA (DXF 8 A)
)
(if (< (cdr (assoc 70 (tblsearch "LAYER" LA))) 4)
(progn
(if (= (DXF 0 A) "ELLIPSE")
(progn
(setq LT (DXF 6 A)
CEN (DXF 10 A)
MINOR% (DXF 40 A)
END_P1 (mapcar '+ CEN (DXF 11 A))
DIS (distance CEN END_P1)
END_P2 (polar
CEN
(+ (angle CEN END_P1) (/ pi 2.0))
(* DIS MINOR%)
)
)
(setq PELMODE (getvar "PELLIPSE"))
(setvar "PELLIPSE" 1)
(setq CLA (getvar "CLAYER"))
(if (/= CLA LA)
(setvar "CLAYER" LA)
)
(command ".ELLIPSE"
"C"
(trans CEN 0 1)
(trans END_P1 0 1)
(trans END_P2 0 1)
)
(setq K (1+ K))
(setvar "PELLIPSE" PELMODE)
(entdel ENT)
(if (/= CLA (getvar "CLAYER"))
(setvar "CLAYER" CLA)
)
(if
(and LT
(/= (DXF 6 (tblsearch "LAYER" LA)) LT)
)
(progn (command ".CHPROP" "L" "" "LT" LT "")
(command ".PEDIT" "L" "L" "ON" "")
)
)
)
)
)
(setq M (1+ M))
)
(setq I (1+ I))
)
(if (> M 0)
(princ (strcat "\n"
(itoa M)
(if (= M 1)
" ELLIPSE was"
" ELLIPSEs were"
)
" on locked layer"
(if (= M 1)
"."
"(s)."
)
)
)
)
(if (> K 0)
(princ (strcat "\n"
(itoa K)
" ELLIPSE"
(if (= K 1)
" was"
"s were"
)
" successfully converted to PLINE"
(if (= K 1)
"."
"s."
)
)
)
)
)
)
(setq *ERROR* OLDERR)
(command ".UNDO" "E")
(if OS
(setvar "OSMODE" OS)
)
(setvar "CMDECHO" CMD)
(princ)
)

"Tim Mathis" wrote in message
news:4854581@discussion.autodesk.com...
Can anyone help with this? I have a drawing and another firm we work for
uses a program that can't read ellipses. I don't know of a way to convert
them...Thanks
Contributor
richardr
Posts: 18
Registered: ‎02-02-2007
Message 5 of 6 (357 Views)

Re: converting ellipse to arc?

04-11-2013 07:05 AM in reply to: *Tim Mathis

Shaun,

 

That is a great .lsp code.  Is there a way to convert the ellipse to arc without making a complete circle?

 

Thanks

 

Richard

*Expert Elite*
Kent1Cooper
Posts: 5,242
Registered: ‎09-13-2004
Message 6 of 6 (345 Views)

Re: converting ellipse to arc?

04-11-2013 10:51 AM in reply to: richardr

richardr wrote:

.... 

That is a great .lsp code.  Is there a way to convert the ellipse to arc without making a complete circle?

....


[Shaun may not still be around after 8 years, but...]

 

If you are on this thread because you also have the problem of some other software not being able to read Ellipses, but if it can read Splines, try this reverse-direction routine [ReverseDirection.lsp with its RD command].  In reversing the direction of an Ellipse [whether a full closed one or a partial one (elliptical arc)], it changes it into a Spline.  [If the direction it runs needs to remain the same as the original Ellipse's, you can reverse it again, and it will remain a Spline rather than reverting to an Ellipse.]

 

This has at least one advantage over drawing an Ellipse as a Polyline with the PELLIPSE System Variable set to 1: precision of the shape of the curve.  An Ellipse drawing with PELLIPSE=1 is rather approximate.  If you use RD instead, and "dumb down" and give it a precision value of only 16, it will have the same number of defining points as a PELLIPSE=1 Polyline version, but will already be closer to the shape of the true ellipse.  If you keep it simpler and accept its default precision of 24, it will be considerably more precise than that, and you can give it a much higher precision if you want it unbelievably precise.

 

But if you have something that can't read Splines either, I think the routine that re-draws it after changing the PELLIPSE System Variable should be adjustable to account for partial Ellipses using the Arc option.

Kent Cooper

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community




Connect with AutoCAD

Twitter

Facebook

Blogs

Pinterest

Youtube