求助:怎样求面积??
<P>在CAD中画 四条相交的直线,怎样能在相交的四边形中点一点而求出四边形面积??</P> 首先获得边界,由该边界多段线的面积属性可得. <P>老兄,怎样获得边界啊??</P> Sub test()<BR> <BR> ' 当前图纸的实体数目<BR> Dim n As Long<BR> n = ThisDrawing.ModelSpace.Count<BR> <BR> ' 调用BOUNDARY命令获取某一点处的边界<BR> Dim Pt As Variant<BR> Pt = ThisDrawing.Utility.GetPoint(, "指定内部点: ")<BR> ThisDrawing.SendCommand "_-Boundary" & vbCr & Pt(0) & "," & Pt(1) & vbCr & vbCr<BR> <BR> ' 如果存在边界,则会生成新的实体<BR> Dim lwpLineObj As AcadLWPolyline<BR> If ThisDrawing.ModelSpace.Count > n Then<BR> Set lwpLineObj = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)<BR> MsgBox lwpLineObj.Area<BR> lwpLineObj.Delete<BR> Else<BR> MsgBox "未发现有效的边界。"<BR> End If<BR>End Sub 太感谢老兄了
页:
[1]