In our solution we need a reference between a Revit model and its presence in the cloud (BIM 360/Autodesk Construction Cloud).
In Revit we open a cloud model or save a model to the cloud (Save As cloud model). The rvt-file obviously "knows" where it is placed in the cloud but I see no way to extract that information from the file. The challenge is therefore to find the files Item id in the cloud.
Currently we do the following:
From the Revit document we get
Then...
(We do not care about the cloud model version).
This actually works, except step 3 can be a bit tricky. It takes several minutes, maybe hours, from the model is uploaded to the cloud until a search is possible which is quite annoying.
So here is two questions:
Which Revit version are you using? If Revit 2022, the new API Document.GetCloudModelUrn() in latest SDK 2022 should be the one you are looking for, and it also provides the following API for cloud info:
Getting the Forge ID for a Model These methods allow you to identify the Forge IDs for Cloud Models:
Document.GetHubId(): ForgeDM hub id where the model is located
Document.GetProjectId(): ForgeDM project id where the model is located
Document.GetCloudFolderId(bool forceRefresh): ForgeDM folder id where the model is located
Document.GetCloudModelUrn(): A ForgeDM Urn identifying the model They return strings which will be empty for a document which is not a cloud model.
Check details at https://help.autodesk.com/view/RVT/2022/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Introduction_Application_and_Document_CloudFiles_html and https://www.revitapidocs.com/2022/7c2bced8-b309-b67f-2b82-13299c617a0b.htm