;;;从AutoCAD 2013 Active Reference帮助中code Examples中提取
;;;本源代码由 xshrimp 2013.2.20 搜集整理,版权归原作者所有!
(vl-load-com)
(defun c:Example_MajorRadius()
;; This example creates an Ellipse in model space and displays
;; both the Major radius and the Minor radius of the new Ellipse
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create an ellipse in model space
(setq center (vlax-3d-point 5 5 0)
majAxis (vlax-3d-point 10 20 0)
radRatio 0.3)
(setq modelSpace (vla-get-ModelSpace doc))
(setq ellObj (vla-AddEllipse modelSpace center majAxis radRatio))
(vla-ZoomAll acadObj)
;; Display radius information
(alert (strcat "The major radius of the new Ellipse is: " (rtos (vla-get-majorRadius ellObj) 2)
"\nThe minor radius of the new Ellipse is: " (rtos (vla-get-minorRadius ellObj) 2)))
)