© 2010 Autodesk
Introduction to Revit 2011 API
Events
Overview
§Also Classified as DB and UI events
§DB events available from Application and Document classes
§UI events available from UIApplication class
§
§Edit model during events using
§Document.IsModifiable
§Document.IsReadOnly
§
§Many of the new pre-events are cancellable
§RevitEventArgs.Cancellable
§RevitAPIPreEventArgs.Cancel
§
§
Events can also be categorized as database (DB) events or user interface (UI) events. DB events are available from the Application and Document classes, while UI events are available from the UIApplication class. (Currently all UI events are at the application level only).
UI events include ApplicationClosing, DialogBoxShowing, Idling, ViewActivating, ViewActivated.

Some events are considered read-only, which means that during their execution the model may not be modified. The fact that an event is read-only is documented in the API help file. It is important to know that even during regular events (i.e. not read-only events), the model may be in a state in which it cannot be modified. The programmer should check the properties Document.IsModifiable and Document.IsReadOnly to determine whether the model may be modified.