如何用vba 快速的获取封闭多段线内每个夹角的度数????
如何用vba 快速的获取封闭多段线内每个夹角的度数????如图,,,每个顶点的坐标都获取到了, 但是不知道怎么去算度数???苦等高手求解??? Utility的AngleFromXAxis AngleFromXAxis: 获取直线与 X 坐标轴的夹角。老师怎么理解???主要是不理解? 哦,好的三克油老师 程序呢@!!!!! 还没做出来呢???不会老师这是明经通道的例子, 得到的 Set lineObj 是弧度???但是弧度我转成角度为什么得到是315度呢???好像不对???生手哈 ! 数学没学好 哈 老师???Sub Example_AngleFromXAxis()
' This example finds the angle, in radians, between the X axis
' and a line defined by two points.
Dim jd As Double
Dim pt1(0 To 2) As Double
Dim pt2(0 To 2) As Double
Dim retAngle As Double
Const PI = 3.141592654
pt1(0) = 2: pt1(1) = 5: pt1(2) = 0
pt2(0) = 5: pt2(1) = 2: pt2(2) = 0
retAngle = ThisDrawing.Utility.AngleFromXAxis(pt1, pt2)
jd = retAngle * 180 / PI
Dim lineObj As AcadLine
Set lineObj = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
ZoomAll
MsgBox "The angle in radians between the X axis and the line is " & retAngle, , "AngleFromXAxis 示例"
End Sub 数学是语文老师教的的,这下坏了坏了
页:
[1]