- Sub DCircle()
- Dim Dist As Double
- Dim Cnt As Integer
- Dim MinR As Double
- Dim MaxR As Double
- Dim Pnt As Variant
- Dim Dir As Double
- On Error Resume Next
- '获得各种数据输入
- With ThisDrawing.Utility
- Pnt = .GetPoint(, vbCr & "请确定起始点位置:")
- Dir = .GetAngle(Pnt, vbCr & "请确定方向:")
- Dist = .GetDistance(Pnt, vbCr & "请输入间距:")
- MinR = .GetDistance(Pnt, vbCr & "请输入最小园半径:")
- MaxR = .GetDistance(Pnt, vbCr & "请输入最大园半径:")
- Cnt = .GetInteger(vbCr & "请输入排列个数:")
- End With
- '生成圆
- Dim i As Integer
- Dim Center As Variant
- Dim Radius As Double
- For i = 0 To Cnt - 1
- Center = ThisDrawing.Utility.PolarPoint(Pnt, Dir, Dist * i)
- Radius = MinR + ((MaxR - MinR) / (Cnt - 1)) * i
- ThisDrawing.ModelSpace.AddCircle Center, Radius
- Next i
- End Sub
|