求教 怎么画部分椭圆
只会画整个椭圆还不会打断,怎么样通过中心和长短轴,起始点,终点或者起始角,画椭圆弧。逆时针选择两点,就打断了。 自贡黄明儒 发表于 2025-5-30 15:53
逆时针选择两点,就打断了。
新手,不会打断啊,VBA代码怎么写?
不会写????????????
水个贴,升级用 RetVal = object.AddEllipse(Center, MajorAxis, RadiusRatio)
创建的是椭圆,椭圆弧得设置起始角和终点角.
你参考官方例子
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
起始角参考
Sub Example_EndAngle()
' This example creates an ellipse and enters the start and
' end angles to create an elliptical arc.
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)
'Enter a start angle of 45 degrees, and an end angle of 270 degrees
ellObj.startAngle = 45 * (3.14 / 180)
ellObj.endAngle = 270 * (3.14 / 180)
ZoomAll
MsgBox "This ellipse has a start angle of " & ellObj.startAngle * (180 / 3.14) & " and the end angle of " & ellObj.endAngle * (180 / 3.14) & " degrees.", vbInformation, "EndAngle Example"
End Sub edata 发表于 2025-6-2 15:20
RetVal = object.AddEllipse(Center, MajorAxis, RadiusRatio)
创建的是椭圆,椭圆弧得设置起始角和终点角. ...
代码实用
页:
[1]