I want to catch drawing modify event, that means if user start to edit current document I want to give a message to user. Can any body help me in this regard? Sample code with VB will be appreciated.
Thanks for your reply. I have tried with that. Below is the sample code. Code is working fine when try to delete a object of just try to modifiy the object. But the problem occurs when I try to add some new object to the drawing. Then objModification sub is executed continuously and I get the message several times. Can you give me a hint that how can I get rid of that?
<CommandMethod("objmod")> Public Sub ObjectModification()
Dim doc AsDocument = Application.DocumentManager.MdiActiveDocument
AddHandler doc.Database.ObjectModified, AddressOf objModification
AddHandler doc.Database.ObjectErased, AddressOf objDelete
Public Sub objModification(sender AsObject, e As ObjectEventArgs)
If e.DBObject.IsModified = True Then
Application.ShowAlertDialog("Object modification is not allowed")
Public Sub objDelete(sender AsObject, e As ObjectErasedEventArgs)
If e.DBObject.IsErased = True Then
Application.ShowAlertDialog("Object delete is not allowed")
The event will fire multiple times. if you look at the properties you will see the first time is *Model_Space and then if I was drawing a polyline the Dimentions throw an error untill the last one.
There was some discussion here
that talked about trapping all the events untill the end.
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!