Message 1 of 3
Not applicable
12-18-2018
04:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am drawing a line using two known point coords.
p1(5411906,88685 | 5813796,25171)
p2(5411721,72968|5813830,60112)
Then I calculate the angle of the line using .AnglefromAxis method.
Somehow there is an inaccuracy between the angle given by the properties window by AutoCAD[349.4902603] (Picture) and the angle calculated [349,362793485571 ]. This is crucial for my main program, so do I have to deal with this inaccuracy or is there a mistake in logic ?
I am thankful for any ideas.
Sub angle()
Dim angle As Double
Dim p1(2) As Double
Dim p2(2) As Double
Dim p1(2) As Double
Dim p2(2) As Double
p1(0) = 5411906.88685
p1(1) = 5813796.25171
p2(0) =5411721.72968
p2(1) =5813830.60112
p1(1) = 5813796.25171
p2(0) =5411721.72968
p2(1) =5813830.60112
angle = ThisDrawing.Utility.AngleFromXAxis(p1, p2)
angle = angle * 180 / 3.xxx-xxxxxxxx
angle = angle * 180 / 3.xxx-xxxxxxxx
Debug.Print angle
ThisDrawing.SendCommand "line" & vbCr & "5411906.88685,5813796.25171" & vbCr & "
5411721.72968,5813830.60112" & vbCr & vbCr
End Sub
Solved! Go to Solution.