I am trying to build a script that transfers files from the Project Files subfolders to the Plans subfolders.
In my BIM 360 Docs I have .rvt models that are linked (e.g. HVAC model linked to the architecture 3D model). When I download a linked model (manually or via the Forge API), I get a .zip file with all the linked models in it.
Is it possible to check which models are linked to an item via the Forge APIs and also in which folder those linked models are stored?
Thank you for your help.
Edit: I tried getting those links by calling versions/:version_id/relationships/refs, but it only shows copies I made from the file.
The links I am trying the get are created in Revit via Insert > Link Revit > Add... and then selecting a file from BIM 360.
Also, when uploading this kind of file (with linked models) manually, to do it correctly I need to select the "upload linked files" option in BIM 360 and then select the parent file.
After you get one version id of one file, you could call versions/:version_id/ relationships/refs. It will tell the relationships of this file with other files. In the structure, fromId is the root file, toId is the xref file. So, if fromId is same to the version_id, that means this file you are checking is a root file. Otherwise, it is one xref (linked) file.
And in the relationships, it will also tell the information of all xrefs file.
The below is the example with my test files.
Root file is urn:adsk.wipprod:fs.file:vf.z4KMn52OT5OIuKamXnzmFw?version=1
Linked file is urn:adsk.wipprod:fs.file:vf.bIJqAo5-TrCmyMy07ELifw?version=1
Using version id of root file:
https://developer.api.autodesk.com/data/v1/projects/ /versions/ urn%3aadsk.wipprod%3afs.file%3avf.z4KMn52OT5OIuKamXnzmFw%3fversion%3d1/relationships/refs
it returns the structure: