Active Member
Posts: 7
Registered: ‎05-01-2009
Message 1 of 2 (87 Views)

Detecting New and Delete Layers

87 Views, 1 Replies
07-22-2009 10:55 AM
Does anyone have procedure for detecting when a new layer is created and when a layer is deleted?
Valued Mentor
Posts: 331
Registered: ‎05-11-2006
Message 2 of 2 (87 Views)

Re: Detecting New and Delete Layers

07-23-2009 07:18 AM in reply to: rhinton
You can monitor the 'ObjectAppended' and 'ObjectErased' events of a Database. In your event handler check to see if the passed in object is of type LayerTableRecord, then you know if the object being added or erased is a Layer and you can take some kind of action. In the ObjectARX dist, look under ..\samples\dotNet\EventsWatcher for some samples of monitoring Database events.
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.