AutoVBA在一个For循环中调用AddArc方法,创建许多不同大小的同心弧,程序代码如下。
Sub lotsofarcs()
Dim newarobj As AcadArc
Dim center As Variant
Dim radius As Variant
Dim startangle As Double, endangle As Double
Dim counter As Integer
With ThisDrawing.Utility
center = .GetPoint(, vbCr & "Click on center point.")
End With
For counter = 1 To 5
radius = counter / 2
startangle = 0
endangle = 180
Set newarcobj = ThisDrawing.ModelSpace.AddArc(center, radius, startangle, endangle)
newarcobj.Update
Next
End Sub
代码完。