AutoVBA利用for循环创建同心圆弧
2011-06-02 22:33 精诚所至 金石为开 阅读(315) 评论(0) 编辑 收藏 举报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
代码完。