GetAngle method example

Sub GetAngle_Example()
    ' This example obtains an angle from the user using the GetAngle method.
    Dim retAngle As Double
    Dim pt(0 To 2) As Double: pt(0) = 3: pt(1) = 3: pt(2) = 0
    ' Return the angle in radians with a prompt
    Dim nDec As Integer: nDec = ThisDrawing.GetVariable("AUPREC")
    retAngle = ThisDrawing.Utility.GetAngle(pt, "Enter an angle: ")
    retAngle = Math.Round(toDegrees(retAngle), nDec)
    MsgBox "The angle entered was " & retAngle & "°", , "GetAngle Example"
End Sub
Private Function toDegrees(ByVal inRadians As Double) As Double
  toDegrees = inRadians * 180 / 3.141592
End Function

© Bricsys NV. All rights reserved.