Reputation: 25
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:
Upvotes: 1
Views: 1100
Reputation: 2024
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
Upvotes: 3
Reputation: 8294
Use the ModelPath
methods GetModelGUID
and GetProjectGUID
.
You can go 'backward' from the model and go up the tree until you hit the Project File or the project Top Folder.
If the user does not have full visibility, the parent folder may not be accessible to a specific user.
Read more under GET projects/:project_id/items/:item_id/parent
.
Upvotes: 0
Reputation: 8294
Your approach is a bit too complex for me to grasp at a glance. without having tried to achieve the same myself. Anyway, The Building Coder discussed how to Determine Cloud Model Local File Path and mentions some similar steps to yours. Maybe that can provide some further hints. Searching here for Revit model cloud turns up numerous other related threads.
Upvotes: 0