- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
With the Plant 3D or AutoCAD .NET API, I can "calculate a vector between two points and determines the angle from the X-axis" like this:
Plant 3D -------------------- Dim pt1 As New Point2d(2142.371247, -2066.73581) Dim pt2 As New Point2d(2142.371247, -1989.581039) Dim angle As Double = pt1.GetVectorTo(pt2).Angle 'RETURNS 1.5707963267948966 IN RADIANS, WHICH IS 90-DEGREES
I'm not able to do likewise with the Revit API however. I've tried the "AngleOnPlaneTo" and "AngleTo" but do not get the expected results as above:
Dim pt1 As New XYZ(2142.371247, -2066.73581) Dim pt2 As New XYZ(2142.371247, -1989.581039) Dim angle2 As Double = pt1.AngleOnPlaneTo(pt2, New XYZ(0, 0, 1)) 'RETURNS 0.01899334843737778 Dim angle3 As Double = pt1.AngleTo(pt2) 'RETURNS 0.018159197737853211
Any suggestions?
Solved! Go to Solution.