- Public Sub TestAddArc()
- Dim varCenter As Variant
- Dim dblRadius As Double
- Dim dblStart As Double
- Dim dblEnd As Double
- Dim objEnt As AcadArc
- On Error Resume Next
- '' get input from user
- With ThisDrawing.Utility
- varCenter = .GetPoint(, vbCr & "Pick the center point: ")
- dblRadius = .GetDistance(varCenter, vbCr & "Enter the radius: ")
- dblStart = .GetAngle(varCenter, vbCr & "Enter the start angle: ")
- dblEnd = .GetAngle(varCenter, vbCr & "Enter the end angle: ")
- End With
- '' draw the arc
- If ThisDrawing.ActiveSpace = acModelSpace Then
- Set objEnt = ThisDrawing.ModelSpace.AddArc(varCenter, dblRadius, _
- dblStart, dblEnd)
- Else
- Set objEnt = ThisDrawing.PaperSpace.AddArc(varCenter, dblRadius, dblStart, dblEnd)
- End If
- objEnt.Update
- End Sub
|