autodesk-forgerevit-apiautodesk-designautomationautodesk-data-managementautodesk-construction-cloud

Accessing Revit Files within ACC from an APS Plugin


I've built an APS Revit plugin that successfully processes Revit file URLs from S3 and GCS. My goal is to extend its functionality to handle URLs pointing to Revit files stored within ACC.

I've granted the necessary permissions to my APS plugin on the ACC project. I'm using following tutorial to access ACC cloud model from APS: https://aps.autodesk.com/blog/design-automation-api-supports-revit-cloud-model

But, when I try to access the file, I'm getting following error:

[04/25/2024 08:02:18] Autodesk.Revit.Exceptions.RevitServerUnauthenticatedUserException: You must sign in to Autodesk 360 in order to complete this action. [04/25/2024 08:02:18] at Autodesk.Revit.DB.ModelPathUtils.ConvertCloudGUIDsToCloudPath(String region, Guid projectGuid, Guid modelGuid) [04/25/2024 08:02:18] at SwappDesignAutomationPlugin.SwappExternalDBApplication.Execute(DesignAutomationData data) [04/25/2024 08:02:18] at SwappDesignAutomationPlugin.SwappExternalDBApplication.HandleDesignAutomationReadyEvent(Object sender, DesignAutomationReadyEventArgs e) [04/25/2024 08:02:18] at DesignAutomationFramework.DesignAutomationBridge.RaiseDesignAutomationReadyEvent(DesignAutomationReadyEventArgs e) [04/25/2024 08:02:18] at RevitCoreEngineTest.RceConsoleApplication.Program.UserMain(CommandLineArgs cl)

I'm using two-legged token for the APS plugin. From documettation, it seemed that if I only want to access the model, without modifying it, it would be enough.

Do I have to switch to three-legged token to access ACC? Am I missing something else?


Solution

  • Do I have to switch to three-legged token to access ACC? Am I missing something else?

    Currently live cloud models in Design Automation for Revit are only supported with 3 legged token. Refer blog announcement for documentation and samples.

    In short, you will provide the user context with the special argument adsk3LeggedToken. We will setup the context and then your Revit API can function similar to how it functions for that user when they login on Desktop.

    There is no plans to support 2 legged token with user impersonation.