Ehsan Barekati
Ehsan Barekati

Reputation: 67

Downloading Revit Models with Links

I am using Forge to download Revit models through this API:

GET buckets/:bucketKey/objects/:objectName

If I try to download a Revit model that contains link documents, I only get one single Revit model (the root file) and none of the linked documents would be downloaded. But if I download the same model directly from BIM 360, it is downloaded as a zip file that contains all the links. How can I get the same behavior through the Forge API?

P.S. I am pretty sure I used to get the proper behavior from Forge API as well, so this might be a regression.

Upvotes: 0

Views: 901

Answers (2)

kai
kai

Reputation: 79

The first thing is to make sure that you have created and linked the files in the proper way, which you probably have, but just to make sure check this.

As Petr Broz mentioned, it is not possible to get a bundle containing all linked files using the forge API. However, you can use

  1. {{FORGE_HOST}}/data/v1/projects/:project/folders/:folder/contents (docs) to get the folder contents of the BIM360 folder. This will give you a tip version id (latest version id) of the file. Look for relationships.tip.data.id of the file you want to download.
  2. With this version ID, query {{FORGE_HOST}}/data/v1/projects/:project/versions/:version/relationships/refs (docs). The data field should contain an array with all incoming and outgoing links. Look for meta.direction to see if it is incoming or outgoing.

This way you can gather all linked versions.

Upvotes: 1

Petr Broz
Petr Broz

Reputation: 9934

The OSS part of the Forge Data Management API is a simple "object storage service", so it doesn't know about any potential references between files. It's actually a feature of the BIM 360 product that it can read the "main" Revit file, retrieve all references from it, and bundle them all together into a ZIP file.

You might however be able to retrieve the references yourself as well, using one of the following Forge APIs:

Upvotes: 1

Related Questions