在给定中心点、长轴上的点和半径比的情况下,在 WCS 的 XY 平面中创建一个椭圆。 支持的平台:仅窗口 签名工 务 局: RetVal = object.AddEllipse(Center, MajorAxis, RadiusRatio) 言论椭圆可以是闭合的,也可以是开放的(椭圆弧),并在当前 WCS 的XY平面上创建。 此对象表示真正的椭圆,而不是折线近似值。 例子工 务 局: Sub Example_AddEllipse() ' This example creates an ellipse in model space. Dim ellObj As AcadEllipse Dim majAxis(0 To 2) As Double Dim center(0 To 2) As Double Dim radRatio As Double ' Create an ellipse in model space center(0) = 5#: center(1) = 5#: center(2) = 0# majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0# radRatio = 0.3 Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio) ZoomAll End Sub Visual LISP: (vl-load-com) (defun c:Example_AddEllipse() ;; This example creates an ellipse in model space. (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) ;; Create the ellipse in mode space (setq modelSpace (vla-get-ModelSpace doc)) (setq ellObj (vla-AddEllipse modelSpace center majAxis radRatio)) (vla-ZoomAll acadObj) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:03
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.