Returns whether the model in the current session is up to date with central.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since: 2014
Syntax
C# |
---|
public bool HasAllChangesFromCentral() |
Visual Basic |
---|
Public Function HasAllChangesFromCentral As Boolean |
Visual C++ |
---|
public: bool HasAllChangesFromCentral() |
Return Value
True means up to date; false means out of date.If central is locked but Revit can determine that the model in the current session is out of date without opening central, this method will return false instead of throwing CentralModelContentionException.
Examples

void ReloadDocument(Document doc) { ReloadLatestOptions reloadOpts = new ReloadLatestOptions(); try { doc.ReloadLatest(reloadOpts); // Check to make sure no new changes were synced with Central during reload if (doc.HasAllChangesFromCentral() == false) { // If there are changes from central, reload again doc.ReloadLatest(reloadOpts); } } catch (Exception e) { TaskDialog.Show("Reload Failed", e.Message); } }

Private Sub ReloadDocument(doc As Document) Dim reloadOpts As New ReloadLatestOptions() Try doc.ReloadLatest(reloadOpts) ' Check to make sure no new changes were synced with Central during reload If doc.HasAllChangesFromCentral() = False Then ' If there are changes from central, reload again doc.ReloadLatest(reloadOpts) End If Catch e As Exception TaskDialog.Show("Reload Failed", e.Message) End Try End Sub
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..CentralFileCommunicationException | The file-based central model could not be reached, because e.g. the network is down or the file server is down. |
Autodesk.Revit.Exceptions..::..CentralModelAccessDeniedException | Access to the central model was denied due to lack of access privileges. -or- Access to the central model was denied. A possible reason is because the model was under maintenance. |
Autodesk.Revit.Exceptions..::..CentralModelContentionException | The central model is locked by another client. |
Autodesk.Revit.Exceptions..::..CentralModelException | Username does not match the one used to create the local file. -or- The central model has been replaced by a local model. -or- Local incompatible because it was closed without saving after synchronizing with central. -or- The central model is missing. -or- The central model is incompatible. -or- The central model is corrupt or not an RVT file. -or- The central model was rolled back. -or- The central model's elements have been relinquished -or- The central model is overritten by other user. -or- An internal error happened on the central model, please contact the server administrator. |
Autodesk.Revit.Exceptions..::..FileNotFoundException | Cannot access the local file. |
Autodesk.Revit.Exceptions..::..InvalidOperationException | This Document is not a workshared document. -or- This Document is a local file that is not owned by the current user, who therefore is not allowed to modify it. |
Autodesk.Revit.Exceptions..::..RevitServerCommunicationException | The server-based central model could not be accessed because of a network communication error. |
Autodesk.Revit.Exceptions..::..RevitServerInternalException | An internal error happened on the server, please contact the server administrator. |
Autodesk.Revit.Exceptions..::..RevitServerUnauthenticatedUserException | User is not sign in to Autodesk 360. |
Autodesk.Revit.Exceptions..::..RevitServerUnauthorizedException | User is not authorized to access the specified A360 project. |