1

In certain circumstances, BIM360 will serve a zip file of a Revit document along with its links, such as explained here: https://forums.autodesk.com/t5/bim-360-document-management/linked-revit-files-in-bim-360-docs/td-p/8774004

In this circumstances, however, when interacting with GET projects/:project_id/folders/:folder_id/contents the file still is shown as a regular file (potentially the isCompositeDesign attribute distinguishes it) with a .rvt file extension. In addition, the filesize shown in storageSize of the object is the sum of the main Revit file and all of its links. Checking the details in GET buckets/:bucketKey/objects/:objectName/details equally show the size object size attribute to be the sum of the main Revit file and all of its links.

I cannot seem to find functionality in Forge that:

  1. Distinguishes a zip file from a lone file (potentially the isCompositeDesign attribute does this)
  2. Provides a list of which other files are linked into the main file, or a list of the zip file contents and their URNs.
  3. Provides a true filesize of the main revit file itself, not just the sum of all linked files in the zip.

Ideas?

Dion Moult
  • 109
  • 4
  • I tried to reproduce the issue, but failed to build the environment. Let me check with engineer team if they have any comments on such requirement. – Xiaodong Liang Aug 16 '19 at 12:21
  • just updating my progress: firstly, I setup the environment and can reproduce the scenario now. As you mentioned, you have found `isCompositeDesign` . The challenges is how to tell if a main file is in zip (packaged status) or not, it looks to me no such API yet (will check further). As to get reference, GET:ref projects/:project_id/versions/:version_id/relationships/refs can tell the references. While it looks no way to tell the exact file size unless the customer calculates himself (after getting main file size and linked file size from `GET:ref` . I will test it further – Xiaodong Liang Aug 20 '19 at 13:40
  • Related to this question. What controls if a BIM 360 project publishes "Composite" files or not? Our hub seems to have a mixture of both. Some projects produce a composite ZIP file with all of the links included (but display name has a .rvt extension). Others publish just the .rvt file as expected. Is there a switch for this somewhere? – Bret Thompson Aug 04 '20 at 16:24
  • @BretThompson I believe it is due to two factors: 1) are there links, and 2) are the links at a particular version which is not the latest. In traditional version controlled systems, this is called the problem of "dependency management", where you'd specify that a file depends on a particular version of another file (i.e. your Revit links to another file, which may not be the latest on BIM360). The proper solution is to notify the user that a particular version was recorded as a link, and let the user resolve it. Unfortunately, Autodesk has decided to simply bundle everything into a huge zip. – Dion Moult Aug 05 '20 at 22:19
  • @BretThompson by the way, the first link in the question explains when it occurs. – Dion Moult Aug 05 '20 at 22:29

1 Answers1

0

Revit 4 worksharing, publishes a file to BIM360.

This file is named as a .rvt file (ie. 'mybigrevitproject.rvt'), but in fact, it's really a zip file in disguise. If you rename it to zip, download it, and unzip it, you'll find lots of .RVT inside the zip.

There's a neat trick to figuring this out, without downloading the entire file.

Use a range GET on the first 16 bytes, and check for the magic header.

For full details, check out this repo: https://github.com/wallabyway

Here's a snippet of the code that will help: https://github.com/wallabyway/bim360-zip-extract/blob/master/server.js#L167

I think it's related to this question: Forge Data management returns zip file

michael beale
  • 1,014
  • 1
  • 6
  • 5