大灰狼1976 发表于 2018-8-25 00:22:33

抄书
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]
查看完整版本: 求助,VBA编程,计算CAD任意图形的面积的程序。紧急