- 积分
- 3124
- 明经币
- 个
- 注册时间
- 2007-1-20
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2010-9-5 18:54:00
|
显示全部楼层
- Sub A()
- Dim StartPoint As Variant, EndPoint As Variant, Radius As Double
- Dim Circle1 As AcadCircle, Circle2 As AcadCircle, V As Variant, Center(2) As Double
- Dim ActiveSpace As AcadBlock
- On Error GoTo 10
- With ThisDrawing
- StartPoint = .Utility.GetPoint(, vbCrLf & "指定圆弧起点:")
- EndPoint = .Utility.GetPoint(StartPoint, "指定圆弧端点:")
- Radius = .Utility.GetDistance(EndPoint, "指定圆弧半径:")
- Set Circle1 = .ModelSpace.AddCircle(StartPoint, Radius)
- Set Circle2 = .ModelSpace.AddCircle(EndPoint, Radius)
- V = Circle1.IntersectWith(Circle2, acExtendNone)
- Circle1.Delete
- Circle2.Delete
- If UBound(V) = -1 Then
- .Utility.Prompt "圆弧半径太小,无效!"
- Else
- Center(0) = V(0): Center(1) = V(1): Center(2) = V(2)
- If .ActiveSpace = acModelSpace Then
- Set ActiveSpace = .ModelSpace
- Else
- Set ActiveSpace = .PaperSpace
- End If
- ActiveSpace.AddArc Center, Radius, .Utility.AngleFromXAxis(Center, StartPoint), .Utility.AngleFromXAxis(Center, EndPoint)
- End If
- End With
- 10: End Sub
|
|