IUpdater

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
All - I am new to Revit, and to the Revit API, but I'm trying to get a jump on Revit use in our office by instituting some standards before we get into serious use on projects. My question is this:
If you want to detect changes to elements in the database, you implement IUpdater and register it with appropriate triggers. Then your Execute method returns an UpdaterData object, whose GetDeletedElementIds() returns a collection of all the IDs of the deleted elements. So far, so good. But, since these are the IDs of deleted elements, document.Element(ElementId) always returns null. Meaning that, unless you are very lucky, you probably can't do anything with all these ElementIds. Hmmmn... What am I missing? My IUpdater uses UniqueIds instead of ElementIds since it deals with objects that persist from session to session. Specifically, I am using the IUpdater to make changes to a group of other elements in the database in response to changes to one element, and storing the UniqueIds of these daughter elements in an ExtensibleStorage.Entity in the primary element. When I delete the primary element, all my extended data goes up in smoke. Don't laugh.
Is there a way to get access to the "ghost" of an element after it is deleted? Or a way to recover its UniqueId from its ElementId? Or is there a way to establish a relationship between an element in the database and view-dependent other elements in the same database that will delete them in a cascade when the primary is deleted? Any ideas?