ReloadLatest Method


Fetches changes from central (due to one or more synchronizations with central) and merges them into the current session.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.484.0)
Since: 2014

Syntax

C#
public void ReloadLatest(
	ReloadLatestOptions reloadOptions
)
Visual Basic
Public Sub ReloadLatest ( _
	reloadOptions As ReloadLatestOptions _
)
Visual C++
public:
void ReloadLatest(
	ReloadLatestOptions^ reloadOptions
)

Parameters

reloadOptions
Type: Autodesk.Revit.DB ReloadLatestOptions
Various options to control behavior of reloadLatest.

Remarks

After this call finishes, use hasAllChangesFromCentral to confirm that there were no Synchronizations with Central performed during execution of ReloadLatest.

Examples

Copy C#
public static void ReloadLatestWithMessage(Document doc)
{
    // Tell user what we're doing
    TaskDialog td = new TaskDialog("Alert");
    td.MainInstruction = "Application 'Automatic element creator' needs to reload changes from central in order to proceed.";
    td.MainContent = "This will update your local with all changes currently in the central model.  This operation " +
                     "may take some time depending on the number of changes available on the central.";
    td.CommonButtons = TaskDialogCommonButtons.Ok | TaskDialogCommonButtons.Cancel;

    TaskDialogResult result = td.Show();

    if (result == TaskDialogResult.Ok)
    {
        // There are no currently customizable user options for ReloadLatest.
        doc.ReloadLatest(new ReloadLatestOptions());
        TaskDialog.Show("Proceeding...", "Reload operation completed, proceeding with updates.");
    }
    else
    {
        TaskDialog.Show("Canceled.", "Reload operation canceled, so changes will not be made.  Return to this command later when ready to reload.");
    }
}
Copy VB.NET
Public Shared Sub ReloadLatestWithMessage(doc As Document)
    ' Tell user what we're doing
    Dim td As New TaskDialog("Alert")
    td.MainInstruction = "Application 'Automatic element creator' needs to reload changes from central in order to proceed."
    td.MainContent = "This will update your local with all changes currently in the central model.  This operation " + "may take some time depending on the number of changes available on the central."
    td.CommonButtons = TaskDialogCommonButtons.Ok Or TaskDialogCommonButtons.Cancel

    Dim result As TaskDialogResult = td.Show()

    If result = TaskDialogResult.Ok Then
        ' There are no currently customizable user options for ReloadLatest.
        doc.ReloadLatest(New ReloadLatestOptions())
        TaskDialog.Show("Proceeding...", "Reload operation completed, proceeding with updates.")
    Else
        TaskDialog.Show("Canceled.", "Reload operation canceled, so changes will not be made.  Return to this command later when ready to reload.")
    End If
End Sub

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
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- Revit could not save all of the worksets that have been changed. Try again. -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 primary document, it is a linked document. -or- This Document is not a local model: it is not workshared or is central. -or- This Document is read-only: It cannot be modified. -or- This Document has an open editing transaction and is accepting changes. -or- This Document has is in an edit mode or is in family mode. -or- This Document is a local file that is not owned by the current user, who therefore is not allowed to modify it. -or- Operation is not permitted when there is any open sub-transaction, transaction, or transaction group.
Autodesk.Revit.Exceptions OperationCanceledException Reload Latest was canceled by the user or by an API event callback.
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.

See Also