Point= ThisDrawing.Utility.GetPoint(, vbCrLf & "选择点") ThisDrawing.Utility.Prompt "X坐标= " & Point(1) & " Y坐标= " & Point(0) & " H高程 =" & Point(2) & Chr(13) & vbCrLf Point1 = ThisDrawing.Utility.GetPoint(, vbCrLf & "选择第一点") Point2= ThisDrawing.Utility.GetPoint(Point1, "选择第二点") D = Sqr(Point2(1)-Point1(1)* Point2(1)-Point1(1) +Point2(0)-Point1(0) * Point2(0)-Point1(0)) FWJ=Fwjjs(Point1,Point2) Public Function Fwjjs(PointA As Variant, PointB As Variant) '方位角 Dim dx As Double Dim dy As Double Dim TR As Double dx = PointB(1) - PointA(1) dy = PointB(0) - PointA(0) If dx = 0 Then TR = Sgn(dy) * PI / 2 Else TR = Atn(dy / dx) If dx < 0 Then TR = TR + PI End If If dx >= 0 And dy < 0 Then TR = TR + 2 * PI Fwjjs = TR End Function Dim objDest As AcadEntity Dim ptBase As Variant ThisDrawing.Utility.GetEntity objDest, ptBase, " 选择对象>>" S = objDest.area
|