Opening a cloud model with Revit API

Opening a cloud model with Revit API

ivo.lafeber
Enthusiast Enthusiast
3,293 Views
7 Replies
Message 1 of 8

Opening a cloud model with Revit API

ivo.lafeber
Enthusiast
Enthusiast

I Have a piece of program in which I open a cloud model, I have 2 projects on the https://docs.b360.autodesk.com server, they open like a charme

A new project which we are starting is on https://docs.b360.eu.autodesk.com  (europe) server.  when I use the same software I get an error code 5 - the central model is missing. 

 

Does anybody recognize this problem ?

 

 

Try
Dim mpcloud As ModelPath = ModelPathUtils.ConvertCloudGUIDsToCloudPath(ProjectGUID, ModelGUID)
Dim DOfcc As New DefaultOpenFromCloudCallback
ActiveUIDoc = app.OpenAndActivateDocument(mpcloud, oo, False, DOfcc)
ActiveDoc = ActiveUIDoc.Document
Catch
LogForm.AddLog("Could not open cloud model. " & Err.Number & " - " & Err.Description)
Err.Clear()
End Try

0 Likes
Accepted solutions (1)
3,294 Views
7 Replies
Replies (7)
Message 2 of 8

jeremy_tammik
Alumni
Alumni
Accepted solution

Maybe you need to update your Revit version.

 

The current Revit API includes a region parameter in the call to ConvertCloudGUIDsToCloudPath:

  

https://www.revitapidocs.com/2022/aa710231-4cab-98ba-951f-00c72e06bb6e.htm

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 8

ivo.lafeber
Enthusiast
Enthusiast

Jeremy,

 

Thanks for pointing me in the right direction.

0 Likes
Message 4 of 8

SONA-ARCHITECTURE
Advocate
Advocate

Hi Jeremy
I think I've covered a lot of the links and topics on the forum but there is one question that remains unanswered for me:

To open a file that is on accdocs, we can use the method: ConvertCloudGUIDsToCloudPath ok, (you wrote it the new functionnlyty here, https://thebuildingcoder.typepad.com/blog/2018/04/whats-new-in-the-revit-2019-api.html#4.1.5) a but how to retrieve the Guid of a file that has never been opened yet (so, not being in the CollaborationCache folder)?
Like other files wich are located in my network, I want to open documents wich are une the cloud...

 

With VisualStudio, I've added the Autodesk Forge reference.

Do I have to get a Token Key in order to Open Revit files wich are in the accdocs of my client?

Hope I'm clear...

Pierre NAVARRA
SONA-Architecture.
http://www.sona-architecture.com
https://fr.linkedin.com/in/pierre-navarra-62032a107
0 Likes
Message 5 of 8

jeremy_tammik
Alumni
Alumni

Dear Pierre, I asked the devteam for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 6 of 8

jeremy_tammik
Alumni
Alumni

Based on the competent answer you received in the other thread on a Problem getting cloud path from files in BIM360, I cancelled the query to the devtam again:

  

https://forums.autodesk.com/t5/revit-api-forum/problem-getting-cloud-path-from-files-in-bim360/m-p/1...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 7 of 8

SONA-ARCHITECTURE
Advocate
Advocate

Dear Jeremy

I was afraid of not having an answer so I published my question in two topics. Thank you for answering me.

Pierre NAVARRA
SONA-Architecture.
http://www.sona-architecture.com
https://fr.linkedin.com/in/pierre-navarra-62032a107
0 Likes
Message 8 of 8

jeremy_tammik
Alumni
Alumni

Dear Pierre, 

  

Thank you very much for moving the ACC Docs related part of the question to StackOverflow:

  

https://stackoverflow.com/questions/75530623/open-files-located-in-the-accdocs

  

Eason Kang very kindly answered it there and provided a complete explanation of how to use APS to retrieve the region, projectGuid and modelGuid data required to populate the arguments to ConvertCloudGUIDsToCloudPath.

   

Best regards,

  

Jeremy

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes