Document文档有一个ObjectErased事件,可以捕获删除。
Private Sub AcadDocument_ObjectErased(ByVal ObjectID As Long)
MsgBox "The ID of the object deleted is: " & ObjectID
Dim tempObj As AcadObject
Set tempObj = ThisDrawing.ObjectIdToObject(objectID)
if 如果不满足条件 then
ThisDrawing.SendCommand "_u" & vbCr
end if
End Sub