' 如果存在边界,则会生成新的实体 Dim lwpLineObj As AcadLWPolyline If ThisDrawing.ModelSpace.Count > n Then Set lwpLineObj = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1) MsgBox lwpLineObj.Area lwpLineObj.Delete Else MsgBox "未发现有效的边界。" End If End Sub