SaveAsCloudModel Method (Guid, Guid, String, String)


Document Save As Cloud Model Method

Saves current non-workshared or workshared model as a cloud model or workshared cloud model in BIM 360 Docs or Autodesk Docs.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public void SaveAsCloudModel(
	Guid accountId,
	Guid projectId,
	string folderId,
	string modelName
)

Parameters

accountId Guid
The BIM 360 Docs or Autodesk Docs account Id. You can use one of the following methods to get this Id:
  • If you get the hub Id with Forge Data Management API, remove the prefix "b." of the Id string and convert the rest to a Guid.
  • If you get the account Id with Forge BIM 360 Docs or Autodesk Docs API, just convert the Id string to a Guid.
projectId Guid
The BIM 360 Docs or Autodesk Docs project Id. You can use one of the following methods to get this Id:
  • If you get the project Id with Forge Data Management API, remove the prefix "b." of the Id string and convert the rest to a Guid.
  • If you get the project Id with Forge BIM 360 Docs or Autodesk Docs API, just convert the Id string to a Guid.
folderId String
Folder identity in BIM 360 Docs or Autodesk Docs to save the model. You can use one of the following methods to get this Id:
  • The folder Id string from Forge Data Management API.
  • The folder Id string from Forge BIM 360 Docs or Autodesk Docs API.
modelName String
Model name in BIM 360 Docs or Autodesk Docs to save the model.
Exceptions
Exception Condition
ArgumentException folderId is an empty string. -or- modelName is an empty string. -or- The input file name "modelName" does not represent a valid file name. -or- Thrown when the input BIM 360 Docs or Autodesk Docs account Id or project Id is invalid or unmatched.
ArgumentNullException A non-optional argument was null
ForbiddenForDynamicUpdateException SaveAs may not be called during dynamic update.
InvalidOperationException Saving is not allowed in the current application mode. -or- This Document is not a project document. -or- This Document is in an edit mode. -or- This Document is not a primary document, it is a linked document. -or- SaveAs is temporarily disabled. -or- This Document is a cloud model, cannot be saved as a cloud model. -or- There is a transaction phase left open (such as a transaction, sub-transaction of transaction group) at the time of invoking this method.
RevitServerCommunicationException Could be for any of the reasons related to network.
RevitServerInternalException Could be for any of the reasons that saveAs fails with RevitServerInternalException.
RevitServerModelAlreadyExistsException Failed due to there is a model with the same name already exists at the specified location.
RevitServerModelNameBreaksConventionException Failed due to the model name is breaking project naming convention.
RevitServerUnauthenticatedUserException User is not signed in with Autodesk id.
RevitServerUnauthorizedException You don't have the entitlement to perform the operation to this this Document. -or- User is not authorized to access the specified cloud project.
Remarks

Assumes that user is currently signed in BIM 360 Docs or Autodesk Docs and has access to Autodesk cloud services. This operation will create a model on cloud and then create a local cache of the cloud model. This method cannot be used when current document is already in cloud.

You can use one of the following methods to save a local model as a workshared cloud model in BIM 360 Docs or Autodesk Docs.

  • If the local model is a workshared model, then it will be a workshared cloud model after you use this method successfully.
  • If the local model is a non-workshared model, you can enable the workset with EnableWorksharing(String, String) and then save as a workshared cloud model.
  • If the local model is a non-workshared model, and you have already saved it as a non-workshared cloud model in BIM 360 Docs or Autodesk Docs, you can still enable the workset with EnableCloudWorksharing to convert it to a workshared cloud model.

You cannot save a local workshared model as a non-workshared cloud model in BIM 360 Docs or Autodesk Docs.

See Also