Basic calculation

#1
Trying to calculate the angle between 2 points after I do the usual:
Set myStartPt = IntelliCAD.ActiveDocument.Utility.GetPoint(, "Pick Startpoint")
Set myEndPt = IntelliCAD.ActiveDocument.Utility.GetPoint(, "Pick Endpoint")

Can someone please help me out ?
Do I get the angle in rad. or degrees ?

Regards

Mr. P.

#2
Mr. P.

Try this code - I added myStartPt to the myEndPt selection to create a rubber band effect for the user.

Code Starts Here --->>>>

Sub TestAngle()
Dim myStartPt As Point
Dim myEndPt As Point
Dim myAngle As Double

Set myStartPt = IntelliCAD.ActiveDocument.Utility.GetPoint(, "Pick Startpoint")
Set myEndPt = IntelliCAD.ActiveDocument.Utility.GetPoint(myStartPt, "Pick Endpoint")

' calculate myAngle (Radians)
myAngle = IntelliCAD.ActiveDocument.Utility.AngleFromXAxis(myStartPt, myEndPt)

' display myAngle in both Radians and Degrees
MsgBox myAngle & " Radians" & vbCr & (myAngle * 180) / (Atn(1) * 4) & " Degrees"

End Sub

Code Ends Here --->>>

------------------
Regards
John Finlay
Don't want to post a question - email me direct on john@acecad.com.au