Application: CloudAPISample
Revit Platform: All
Revit Version: 2022.0
First Released For: 2022.0
Programming Language: C#
Skill Level: High
Category: Basics
Type: ExternalApplication

Subject: Revit Cloud API Usage Sample
Summary: 
This is a sample helps third party developers understand how to use Revit Cloud API

Classes:
Revit.SDK.Samples.CloudAPISample.CS.Application
Revit.SDK.Samples.CloudAPISample.CS.RunSample
Revit.SDK.Samples.CloudAPISample.CS.SampleContext
Revit.SDK.Samples.CloudAPISample.CS.SampleEngine
Revit.SDK.Samples.CloudAPISample.CS.Coroutine.Coroutine
Revit.SDK.Samples.CloudAPISample.CS.Coroutine.CoroutineScheduler
Revit.SDK.Samples.CloudAPISample.CS.Migration.DefaultMigrationModel
Revit.SDK.Samples.CloudAPISample.CS.Migration.FolderLocation
Revit.SDK.Samples.CloudAPISample.CS.Migration.IMigrationModel
Revit.SDK.Samples.CloudAPISample.CS.Migration.MigrationRule
Revit.SDK.Samples.CloudAPISample.CS.Migration.MigrationToBim360
Revit.SDK.Samples.CloudAPISample.CS.View.ViewMigrationToBim360
Revit.SDK.Samples.CloudAPISample.CS.View.ViewSamplePortal

Project Files: 
Application.cs
It contains the class Application which inherits from the interface IExternalApplication and creates the UI ribbon components when Revit starts.
It contains the class RunSampleCommand which inherits from the interface IExternalCommand and is expected to be triggered by the ribbon button above.
SampleContext.cs
It contains the class SampleContext which is the base class for each case context in samples portal.
SampleEngine.cs
It contains the class SampleEngine which manages all SampleContext.
Coroutine.cs
It contains the class Coroutine which represents a coroutine instance that can execute asynchronously within WPF.
CoroutineScheduler.cs
It contains the class CoroutineScheduler which allows for control over the execution regime a set of coroutines.
UIMigrationViewModel.cs
It contains the class UIMigrationViewModel which provides user BIM360 project information and configuration for this sample.
IMigrationModel.cs
It contains the interface IMigrationModel which should be implemented by any view model used in MigrationToBim360 sample.
MigrationToBim360.cs
It contains the class MigrationToBim360 gives user a sample about how to migrate A360 Teams project to BIM360 Docs.

Description: 
This sample provides following functionalities.
-	Let user upload models to BIM360 Docs with initiate API.
-	Let user read and write model’s link info with link API. 
-	Let user migrate models from A360 Team to BIM360 Docs. 

Instructions: 
Open Revit application and execute the command.
1.	Step 1. Download.
a.  Manually download cloud models from anywhere, such as BIM 360 Team via eTransmit package.
b.  Click “...” to select a folder location.
Expected result: All models which user wants to migrate have been placed in destination folder.

2.	Step 2. Config.
a.	Click “Configuration” to input target cloud information.
b.	Click “+” to add rules to the target folder for models with a specific pattern. The first rule is assigned the highest priority.
c.	A model with no matching pattern will be uploaded to the folder specified by the last rule in the list.
Expected result: Account Id and Project Id have been given correctly. Rules can cover all models in destination folder. A “*” pattern is recommended to given in lowest priority.

3.	Step 3. Upload
a.	Ensure you are logged in to your Autodesk Account.
b.	Click “Upload” to upload models to the target cloud folder.
Expected result: All models in destination folder have been uploaded to target location. 

4.	Step 4. Reload linked models.
a.	Click “Refresh” to direct links to the correct model in the cloud.
Expected result: All link data of models uploaded to target project has pointed to correct cloud model.