MajorRadius 属性 (ActiveX)
指定椭圆的长轴的长度。 支持的平台:仅限 Windows 属性值只读:不 类型:双 椭圆的长轴长度。 言论椭圆的长轴称为长轴;较短的是短轴。 例子VBA: Sub Example_MajorRadius() ' This example creates an Ellipse in model space and displays ' both the Major radius and the Minor radius of the new Ellipse Dim ellObj As AcadEllipse Dim majAxis(0 To 2) As Double, 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) ThisDrawing.Application.ZoomAll ' Display radius information MsgBox "The major radius of the new Ellipse is: " & ellObj.majorRadius & vbCrLf & _ "The minor radius of the new Ellipse is: " & ellObj.minorRadius End Sub 可视化 LISP: (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))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 11:57
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.