搞定,谢谢楼上的解答 代码如下: n = ThisDrawing.ModelSpace.Count ThisDrawing.SendCommand ("snap" & vbCr & "off" & vbCr) '关闭捕捉功能 pt = ThisDrawing.Utility.GetPoint(, vbCr & "指定下一内部点:" & vbCr) '取得内部点 If Err Then Err.Clear Exit Function End If ThisDrawing.SendCommand "-Boundary" & vbCr & pt(0) & "," & pt(1) & vbCr & vbCr If ThisDrawing.ModelSpace.Count > n Then Set objPoly = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1) Else MsgBox "未发现有效的边界。" Exit Function End If 再次感谢楼上的高人 |