Edited View Parameter not reporting ModelUpdatesStatus correctly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am developing an app for Autodesk Revit 2022 and above that will track and record when someone creates a view or opens a view. This tool will allow us to determine when certain views were last used and whether we can remove them from our models. All views contain a shared parameter called "View_LastOpened". When someone opens a view this information is saved into memory. When the user synchronises I use the DocumentSynchronizing event to write this into the view and then relinquish it post sync during an idling event. This all works fine until two people open a view and one synchronizes after another. The second person is notified with a Revit Dialog that they need to reload latest.
When I use the following checks on the view it reports that the view is current with the central file and doesn't need reloading, even though it does to change the parameter value.
if (WorksharingUtils.GetCheckoutStatus(doc, view.Id) == CheckoutStatus.OwnedByOtherUser)
continue;
var elementInfo = WorksharingUtils.GetModelUpdatesStatus(doc, view.Id);
if (elementInfo == ModelUpdatesStatus.UpdatedInCentral)
continue;If there are any attempts to changes the parameter value through either manually or via the api (parameter.Set()) it triggers a reload request and the Revit Reload dialog.
How can I determine whether the shared parameter on the view has been updated in the central? I need this so I can intercept it and skip the update. I can't intercept all reload dialog requests as there may be other elements that genuinely require reloading.
Is this an API oversight, or a design feature?