© 2010 Autodesk
Introduction to Revit 2011 API
Dynamic Model Update
Registration and Triggers
§Register the Updater
§OnStartUp for application level scope
§ExternalCommand for command level scope
§
§
§
§
§Add Trigger
§Change of Scope - list of ElementIds or list of elements via ElementFilter.
§Change of Type - addition, deletion and modification
§
§
WindowUpdater updater = new WindowUpdater(application.ActiveAddInId );
// Register the updater in the singleton UpdateRegistry class
UpdaterRegistry.RegisterUpdater( updater );
// Set the filter
ElementClassFilter filter = new ElementClassFilter( typeof( Wall ) );
// Add trigger
UpdaterRegistry.AddTrigger(updater.GetUpdaterId(),filter,                     Element.GetChangeTypeGeometry());    
The next step is to register the Updater class in the onStartUp method of the external application. We create a new instance of the Updater class. Using the application level singleton UpdaterRegistry class which stores all the registered Updaters, we can use its RegistryUpdater() method to register the Updater object.

The process of subscribing an Updater is done using update triggers. Update triggers are combination of “Change Scope” and “Change Type”. Change Scope may either be an explicit list of element Ids or an implicit list of elements communicated via the ElementFilter. Change Type represents one of possible changes including element addition, deletion and modification of geometry, parameters or any property of the element.