1

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?

3
  • 1
    Are y ok trying to access live cloud model or a published version? Commented Apr 16, 2024 at 11:34
  • Thank you for your quesion, it made me to refine the requirements. I have clearfied and modified my question. Commented Apr 25, 2024 at 10:02
  • Thank you. As you guessed it, you will need a 3 LO token. I shared the relevant documentation in my answer. Commented Apr 25, 2024 at 15:29

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Need some help here :( I am passing in a valid 3 legged token to my work item and still getting the RevitServerUnauthenticatedUserException error. My workItem looks like: { "activityId": "{{dasNickName}}.NVCMActivityTXT+testTXT", "arguments": {... }, "result": { ... }, "adsk3LeggedToken" : "{{adsk3LeggedToken}}" } Any idea what may be wrong? {{adsk3LeggedToken}} is a valid 3 legged token that works in other APS calls - like Get Projects etc.
0

If your ACC File URL looks like the below one, we can extract project id and item item from it, and then call Data Management API.

https://acc.autodesk.com/docs/files/projects/e976d832-93f7-44d3-9051-625bf228d216?folderUrn=urn%3Aadsk.wipprod%3Afs.folder%3Aco.j0erY7apSNGl6hJHUTHhOQ&entityId=urn%3Aadsk.wipprod%3Adm.lineage%3AmgJecIvQQ2OfqTbZSH8zxg&viewModel=detail&moduleId=folders&viewableGuid=250a6ce5-ee70-fdca-bfc9-4111f54e9baa

The project id from above is e976d832-93f7-44d3-9051-625bf228d216. For using Data Management API, we must append b. to this guid. i.e. b.e976d832-93f7-44d3-9051-625bf228d216.

The item id of the Revit from the above is urn%3Aadsk.wipprod%3Adm.lineage%3AmgJecIvQQ2OfqTbZSH8zxg, which URL encoded. We can System.Web.HttpUtility.UrlDecode to decode it to urn:adsk.wipprod:dm.lineage:mgJecIvQQ2OfqTbZSH8zxg.

And then follow this tutorial to download the Revit file stored on ACC: https://aps.autodesk.com/en/docs/bim360/v1/tutorials/document-management/download-document-s3/, if your Revit model is not Revit cloud models or cloud worksharing models.

1 Comment

I wasn't clear enough with my quesion, I want to access the model directly from APS, without need to download it and then reference to APS. I think, that recent API for integrating ACC cloud models with APS is exactly what I need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.