Public Sub GetArea()
Dim n&
n = ThisDrawing.ModelSpace.Count
Dim pt
pt = ThisDrawing.Utility.GetPoint(, "选择内部点:")
ThisDrawing.SendCommand "-Boundary" & vbCr & pt(0) & "," & pt(1) & vbCr & vbCr
Dim objPoly As AcadLWPolyline
If ThisDrawing.ModelSpace.Count > n Then
Set objPoly = ThisDrawing.ModelSpace.Item(n)
MsgBox objPoly.Area
objPoly.Delete
Else
MsgBox "未发现有效边界!"
End If
End Sub
页:
1
[2]