+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Senior Member
    Using
    Civil 3D 2011
    Join Date
    Aug 2011
    Posts
    151

    Default Convert Ellipse to Arc

    Registered forum members do not see this ad.

    I have been trying to figure this out for a couple of days now. The only thing I could find is this LISP that takes the Ellipse properties and uses them to creat an arc.

    When I use this, the start and end angles are not correct in the drawing. Ellipses must have been drawn in a different UCS).

    I have tried to get the LISP to use the start and end points of the ellipse along with the radius and center point. For the life of me I cannot figure it out. If anyone knows how to do this please let me know.

    *NOTE* Elllipses that I am trying to convert have the same minor and major radii.

    Thanks in advance!!


    Code:
     
    (defun c:e2a (/ acaddoc acadms acadobj center endangle obj radius ss ssn startangle)
      (vl-load-com)
      (if 
        (setq ss (ssget '((0 . "ellipse"))))
        (progn      
          (setq acadobj (vlax-get-acad-object))
          (setq acaddoc (vla-get-activeDocument acadobj))
          (setq acadms (vla-get-modelspace acaddoc))
          (setq ssn (ssname ss 0))
          (setq obj (vlax-ename->vla-object ssn))
          (if
     obj ;(equal (vla-get-RadiusRatio obj) 1 0.0001)
     (progn
       (setq radius (vla-get-MajorRadius obj))
       (setq Startangle (vla-get-Startangle obj))
       (setq Endangle (vla-get-Endangle obj))
       (setq Center (vlax-get obj 'center))
       (entdel ssn)
       (vla-addarc acadms (vlax-3d-point Center) radius Startangle Endangle)
       ) ; progn
     (alert "> Ellipse objects failed to be converted")
     )   ; if
          )     ; progn
        )       ; if
      (princ)
      )       ; defun

  2. #2
    Senior Member
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Bulgaria, Sofia
    Posts
    237

    Default

    I am not sure that getting an arc from ellipse is possible. The arc is part of a circle.
    The equation of a circle is (X-X1)^2 + (Y-Y1)^2=R^2.
    The equation of an ellipse is (X^2)/(A^2) + (Y^2)/(B^2) = 1

    It seems that an arc and an ellipse can only have common graphics if A = B which makes the ellipse circle....

  3. #3
    Senior Member
    Using
    Civil 3D 2011
    Join Date
    Aug 2011
    Posts
    151

    Default

    Registered forum members do not see this ad.

    The ellipse that I am lloking to replace with an arc has the same major and minor radii, therefore it is an arc. If we use the start and end points as well as the radius, we can construct an arc.

    Lee Mac helped me out with a LISP program that works wonders!!

    http://www.cadtutor.net/forum/showth...Ellipse-to-Arc

Similar Threads

  1. Convert Ellipse to Arc
    By Bill_Myron in forum AutoLISP, Visual LISP & DCL
    Replies: 17
    Last Post: 18th Mar 2017, 12:47 pm
  2. Convert Ellipse to Arcs
    By jammie in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 27th Feb 2015, 10:05 pm
  3. How to convert LINE, ARC, SPLINE,ELLIPSE to POLYLINE
    By cadamrao in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 16th Jun 2010, 03:57 pm
  4. ellipse won't convert to polyline
    By zera in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 7
    Last Post: 17th Dec 2009, 09:19 pm
  5. ellipse
    By pjl66892 in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 29th Sep 2006, 10:08 pm

Tags for this Thread

Bookmarks

Posting Permissions

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