How to Unregister Updater?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am writing an AddIn which adds a custom View and uses Document-bound Updaters to manage some information in it. These updaters are non-optional as long as there are custom views in the document, however, they aren't needed as soon as all AddIn-created views are deleted.
To achieve this, I tried:
I only register the updater upon creation of custom views or when I find some upon loading. (This works)
Upon saving, I test for AddIn-created views, if there aren't any left, I do
Autodesk.Revit.DB.UpdaterRegistry.UnregisterUpdater(id, doc);
which appears to succeed, as the Updater isn't called anymore and repeating calls to this fail with the message that the updater doesn't exist anymore.
However, if I try to load that document, I get the warning that the Updaters are missing.
How can I tell Revit that a previously used Updater won't be needed anymore?
EDIT: I know that I could just always register the updater, but this won't help users who don't have my AddIn.
EDIT2: Btw, I'm using Revit2017, if that makes any difference.