Start / EndAngle properties example


Sub EndAngle_Example()
' This example adds an arc to the drawing and returns the start & end angles.
     Dim myArc As AcadArc
     Dim ctrPt(0 To 2) As Double
     ctrPt(0) = 5: ctrPt(1) = 3
     'Add the arc to the .dwg
     Set myArc = ThisDrawing.ModelSpace.AddArc(ctrPt, 2.5, toRadians(15), toRadians(105))
     ThisDrawing.Application.ZoomExtents
     Dim dStartAngle As Double
     Dim dEndtAngle As Double
     dStartAngle = toDegrees(myArc.startAngle)
     dEndtAngle = toDegrees(myArc.endAngle)
     MsgBox "Start Angle = " & dStartAngle & Chr(13) & "End Angle = " & dEndtAngle
End Sub
Function toRadians(ByVal inDegrees As Double) As Double
  toRadians = inDegrees * 3.141592 / 180
End Function
Function toDegrees(ByVal inRadians As Double) As Double
  toDegrees = inRadians * 180 / 3.141592
End Function

© Bricsys NV. All rights reserved.