© 2010 Autodesk
Introduction to Revit 2011 API
Events
Overview
§Notifications triggered on specific actions
§Complaint to .NET event standard
§Pre and Post events
§Single event (DocumentChanged and FailureProcessing)
§Currently not supported in VSTA
§
§Types :
§Application level
§Document level
§
§
Events are notifications that are triggered on specific actions in the Revit user interface or API workflows. By subscribing to events, an add-in application can be notified when an action is about to happen or has just happened and take some action related to that event.

Since Revit 2010, the events API is .NET complaint. Some events come in pairs around actions, one occurring before the action takes place (―pre event) and the other happening after the action takes place (―post event). Events that do not occur in these pre/post pairs are called ―single events.

Events are not supported in VSTA.

Revit provides access to events at both the Application level (such as ApplicationClosing or DocumentOpened) and the Document level (such as DocumentClosing and DocumentPrinting).
The same application level events available from the Application class are also available from the ControlledApplication class, which represents the Revit application with no access to documents. It is ControlledApplication that is available to add-ins from the OnStartup() and OnShutdown() methods.