如何判断getentity 未选择图形对象
各位: Dim returnobj As AcadObjectDim basepnt As Variant
ThisDrawing.Utility.GetEntity returnobj, basepnt, "select file name to save"
在提示“select file name to save"”若用户未选择图形对象,点了空白处会出错。
出错对话框如下:file:///
如何判读用户未点选图形对象呢 ?好进行后面的容错处理!
判断哪个错误号,以确定就是“用户未选择图形对象” on error goto err1
exit sub
err1
....... 试试看,谢谢! 还是没用啊,
Public Sub ss()
On Error GoTo err1
Dim returnobj As AcadObject
Dim basepnt As Variant
ThisDrawing.Utility.GetEntity returnobj, basepnt, "select file name to save"
Exit Sub
err1:
If Err.Number = -2147352567 Then MsgBox "没选择对象"
End Sub
页:
[1]