目的是选取任意两点计算方位角,代码如下: Sub calculateangel() Dim point1 As Variant Dim point2 As Variant p1 = ThisDrawing.Utility.GetPoint(, vbCrLf & "第一点:") p2 = ThisDrawing.Utility.GetPoint(, vbCrLf & "第二点:") Const pi As Single = 3.14 Dim x As Double Dim y As Double Dim z As Double Dim ang1to2 As Double x = point1(0) - point2(0) y = point1(1) - point2(1) z = point1(2) - point2(2) ang1to2 = pi - Sgn(y) * pi / 2 - Atn(y / x) MsgBox "两点之间的方位角为:" & ang1to2, , "个计算单位" End Sub 希望高手尽快给个解答!