IOpenFromCloudCallback Interface


IOpen From Cloud Callback Interface

An interface that may be used to control Revit's behavior when opening a cloud model.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public interface IOpenFromCloudCallback

The IOpenFromCloudCallback type exposes the following members.

Methods
Name Description
Public method OnOpenConflict A method called when the conflict is happen during the model opening.
Top
Example
C#
class OpenFromCloudCallback : IOpenFromCloudCallback
{
   public OpenConflictResult OnOpenConflict(OpenConflictScenario scenario)
   {
      switch (scenario)
      {
         case OpenConflictScenario.OutOfDate:
            // Continue to open the model so that I can save my local changes to the central model
            return OpenConflictResult.KeepLocalChanges;

         case OpenConflictScenario.VersionArchived:
            // My local model is far behind the central model, so discard my local changes regardless what they are
            return OpenConflictResult.DiscardLocalChangesAndOpenLatestVersion;

         case OpenConflictScenario.Relinquished:
         case OpenConflictScenario.Rollback:
            // Detach the loal model from its central model, to examine local changes
            return OpenConflictResult.DetachFromCentral;
      }

      return OpenConflictResult.Cancel;
   }
}

static Document OpenCloudModelWithCallback(Application application, ModelPath modelPath)
{
   OpenOptions options = new OpenOptions();
   OpenFromCloudCallback callback = new OpenFromCloudCallback();

   return application.OpenDocumentFile(modelPath, options, callback);
}
See Also
ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →