[求助]求源代码
<p> </p><p> <font size="5"><strong>求VBA环境下编辑的<font size="6">要求查询坐标,方位角,距离和面积的源代码</font></strong></font></p> <p>Point= ThisDrawing.Utility.GetPoint(, vbCrLf & "选择点")<br/>ThisDrawing.Utility.Prompt "X坐标= " & Point(1) & " Y坐标= " & Point(0) & " H高程 =" & Point(2) & Chr(13) & vbCrLf</p><p>Point1 = ThisDrawing.Utility.GetPoint(, vbCrLf & "选择第一点")<br/>Point2= ThisDrawing.Utility.GetPoint(Point1, "选择第二点")<br/>D = Sqr(Point2(1)-Point1(1)* Point2(1)-Point1(1) +Point2(0)-Point1(0) * Point2(0)-Point1(0))</p><p>FWJ=Fwjjs(Point1,Point2)</p><p>Public Function Fwjjs(PointA As Variant, PointB As Variant) '方位角<br/> Dim dx As Double<br/> Dim dy As Double<br/> Dim TR As Double<br/> dx = PointB(1) - PointA(1)<br/> dy = PointB(0) - PointA(0)<br/> If dx = 0 Then<br/> TR = Sgn(dy) * PI / 2<br/> Else<br/> TR = Atn(dy / dx)<br/> If dx < 0 Then TR = TR + PI<br/> End If<br/> If dx >= 0 And dy < 0 Then TR = TR + 2 * PI<br/> Fwjjs = TR<br/>End Function</p><p>Dim objDest As AcadEntity<br/>Dim ptBase As Variant<br/>ThisDrawing.Utility.GetEntity objDest, ptBase, " 选择对象>>"<br/>S = objDest.area<br/></p><p></p> 谢谢啊 <p> 好像只有求坐标的没出问题,其他的都有问题呀。。</p>
页:
[1]