如何写“通过点选获得封闭区域面积”的代码
<p>想用VB6如何实现以下的功能:</p><p>利用鼠标点选功能先获得对一个封闭区域的选择,然后获得该区域的面积。</p><p>谢谢</p> <p>给你一段VBA代码,自己改到VB中</p><p>Public Sub FB_Area()<br/> Dim cecho As Variant<br/> cecho = ThisDrawing.GetVariable("cmdecho")<br/> ThisDrawing.SetVariable "cmdecho", 0<br/> Dim pt As Variant<br/> pt = ThisDrawing.Utility.GetPoint(, "点击封闭区域内部...")<br/> Dim spt As String<br/> spt = pt(0) & "," & pt(1)<br/> ThisDrawing.SendCommand Chr(3) & Chr(3) & "-boundary " & spt & " " & " "<br/> ThisDrawing.SendCommand "draworder last f "<br/> ThisDrawing.SendCommand "_.area o last "<br/> ThisDrawing.SendCommand Chr(3) & Chr(3)<br/> MsgBox vbCrLf & "封闭区域面积为:" & CStr(ThisDrawing.GetVariable("AREA"))<br/> ThisDrawing.SetVariable "CMDECHO", cecho<br/> End Sub</p> <p>谢谢</p> <p>谢谢 我先试试</p>
页:
[1]