Message 1 of 13
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can someone please explain to me why this works:
Sub Example_AngleFromXAxis()
' This example finds the angle, in radians, between the X axis
' and a line defined by two points.
Dim pt1(0 To 2) As Double
Dim pt2(0 To 2) As Double
Dim retAngle As Double
pt1(0) = 256833.405419725: pt1(1) = 5928142.14654379: pt1(2) = 0
pt2(0) = 256890.630751811: pt2(1) = 5928014.31962269: pt2(2) = 0
' Return the angle
retAngle = ThisDrawing.Utility.AngleFromXAxis(pt1, pt2)
' Create the line for a visual reference
Dim lineObj As AcadLine
Set lineObj = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
ZoomAll
' Display the angle found
MsgBox "The angle in radians between the X axis and the line is " & retAngle, , "AngleFromXAxis Example"
End SubBut, when those same coordinates are passed from another array is doesn't work??
.......... pt1(0) = CDbl(blockLocation(0)): pt1(1) = CDbl(blockLocation(1)): pt1(2) = 0 pt2(0) = CDbl(blockLocation(2)): pt2(1) = CDbl(blockLocation(3)): pt2(2) = 0 retAngle = acadDoc.Utility.AngleFromXAxis(pt1, pt2) ..........
??
Solved! Go to Solution.
