© 2010 Autodesk
Introduction to Revit 2011 API
Lab - Dynamic Model Update
    //' construct our updater.
    WindowDoorUpdater winDoorUpdater = new WindowDoorUpdater(application.ActiveAddInId);
    //' ActiveAddInId is from addin menifest.
    //' register it
    UpdaterRegistry.RegisterUpdater(winDoorUpdater);
    //' tell which elements we are interested in notified.
    //' we want to know when wall changes it's length.
    //'
    ElementClassFilter wallFilter = new ElementClassFilter(typeof(Wall));
    UpdaterRegistry.AddTrigger(winDoorUpdater.GetUpdaterId(), wallFilter, Element.GetChangeTypeGeometry());
In this lab, after registering the Updater, we need to add triggers to complete the Updater subscription process. The change of scope for the trigger in this case is an implicit list of elements (walls in this case since we want to trap the change of length of any wall in the model) and this is communicated via the ElementClassFilter. The change type part of the trigger represents the element modification which is mentioned using the Element.GetChangeTypeGeometry. Finally, we use the Singleton UpdaterRegistry class again and use its AddTrigger() method to add the trigger. This trigger expects the updater Id, change scope information (filter) and the change type information (where it is element addition, deletion or modification) as parameters.