- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've worked with IUpdaters in Revit 2020 fairly frequently for a number of different elements, but I'm seeing some behavior with floors that seems less than ideal. My testing centers around either one of the following triggers:
UpdaterRegistry.AddTrigger(myFloorCreatedUpdater.GetUpdaterId(),
new ElementClassFilter(typeof(Floor)),
Element.GetChangeTypeElementAddition());
OR
UpdaterRegistry.AddTrigger(myFloorCreatedUpdater.GetUpdaterId(),
new ElementCategoryFilter(BuiltInCategory.OST_Floors),
Element.GetChangeTypeElementAddition());
Based on these triggers, the associated IUpdater actually fires before a new floor placement is complete. Instead of the IUpdater Execute() firing after the you draw the floor and "Finish Edit Mode", it fires as soon as you enter Edit Mode. Then when you "Finish Edit Mode", it also triggers the IUpdater for
Element.GetChangeTypeGeometry()
This behavior seems problematic for several reasons:
- First of all, Floor Edit Mode can be cancelled without creation of a floor, meaning that the ElementId captured by the UpdaterData was not actually created in the Document.
- In addition, it means that virtually all usable information about the floor is meaningless at the moment that the IUpdater is fired. Geometry cannot be extracted because the floor boundary has not yet been drawn. And the floor type may be changed before finishing Edit Mode, so the CompoundStructure information for the floor cannot be trusted.
- For instances where the developer finds it necessary to distinguish between "new floor created" versus "existing floor modified", it is problematic that the floor creation ALSO triggers Element.GetChangeTypeGeometry()
Hypothetically, you could accomplish some things by moving your logic to the change updater instead of the addition updater, but this will leave you with some headache if you need to distinguish between new and existing floors. Wouldn't this mean the the addition updater is essentially useless for this purpose?
I'd love to hear any thoughts that everyone has on this. Is this the intended and expected behavior for IUpdaters that are triggered by floor creation? Has anyone else experienced difficulty with this behavior?
Solved! Go to Solution.