Reliably Determine Revit Version of BIM 360 Project - autodesk-forge

Design Automation AppBundles for Revit require the identification of the Revit engine, which includes the version (year) of Revit. So to make a Design Automation to support multiple Revit versions, there will be multiple AppBundles, and multiple Activities based on these years. Which is no problem, but how do I determine the version year of the BIM 360 project or the .rvt file to submit a work item to the correct activity? It seems like this data should be available since Revit will only list BIM360 Projects that are in the same version as the copy of Revit opened.
This thread from 2 years ago suggests it is not possible, but has that changed?
I also found this blog post to download the beginning of the file to get this data, but this appears to only work on single user files, and does not work for workshared RVT files, and all of our BIM360 projects are workshared.
Are there any new options?
EDIT: To clarify, I'm in search of a method to determine the Revit version of a workshared RVT file that is stored in BIM 360. Preferably without downloading the file from BIM 360. The Revit version of the entire "Project" on BIM 360 would work as well, but I don't see that in the project information returned by the BIM 360 API or the Data Management API.

You can determine the Revit version of an RVT file by accessing its BasicFileInfo properties. This can be done without opening the file in question. However, it does require the Revit API, and hence a Revit installation.
The Building Coder shares some other solution enabling Revit RVT file version determination without the Revit API, cf., e.g., RvtVerFileOpen – Open Correct RVT File Version and Determining RVT File Version Using Python.

Update: In his tweet, Augusto points out that you can now check the version of a Revit file hosted on the cloud simply by reading the RVTVersion attribute in the Document Information manifest properties.

Related

Can you query, translate, and open .dwg files from web.autocad.com's Web & Mobile directories?

Background: I have a simple integration (Client App) using the Forge API that can: create a bucket, upload a .dwg file to the object storage service, translate the file (and get translation status), query the files in a bucket, and open any of the files in the bucket in the Viewer. I'm now researching the possibility to pull files that are made/modified from the AutoCAD Web & Mobile App (https://web.autocad.com/) (aka the Web App) via the forge API. Is this possible?
Usecase: We want some personnel to be able to modify the underlying files, whereas others just need to view it from an existing application integrated through forge. The idea would be the engineers would modify the file in the Web App, and then from the Client App using the forge API, I want to query to see if the base file has been updated since the last time it was translated for the viewer. If newer, re-translate the file and view it. If not, just view it.
Attempts: I assumed the files would be in a project in a hub in the /project/v1/hubs/ in the data management API of Forge, but I'm getting a response of "You don't have permission to access this API". I am in the trial version of forge, so that may be the issue. And the Web App is currently "free for everyone for an extended period." Is it possible that I just need to purchase one of the subscriptions to be able to access the files I have on the web app? Or am I looking in the entirely wrong place?
So, concisely, here are the questions:
Are files that are saved on https://web.autocad.com/ accessible via the Forge API? How, if yes?
If yes to #1, do these files need to be converted using the Forge API to be render-able in the Viewer?
Thank you for your time and help!
I would say, it's a pretty cool idea and workflow, but unfortunately, AFAIK, we don't have direct access to file on https://web.autocad.com/ by Forge API currently, only data within Autodesk SAAS applications include BIM 360 Team, Fusion Team (formerly known as A360 Team), BIM 360 Docs, A360 Personal could be accessed directly, refer https://forge.autodesk.com/en/docs/data/v2/developers_guide/overview/, But some ideas:
I am not expert on https://web.autocad.com, but I know it provides the connection to cloud storage including Box, Dropbox, Google Drive, and Microsoft OneDrive, depends on which cloud storage you are using, you should pick the corresponding API to access the file, and maybe check if the file is changed, all of that is nothing to do with Forge, but the cloud storage.
If you can check the file version with the API from cloud storage provider, then you should be able to exchange the file between the cloud storage and Autodesk OSS(check sample https://github.com/Autodesk-Forge/bim360appstore-data.management-nodejs-transfer.storage ), you can use the Forge to translate and view files on Autodesk OSS.

Autodesk Forge viewer: Directly load a SVF?

As the official documentation states, you can upload a source file to OSS and translate it, once in your bucket, to a SVF with the Model Derivative API.
But is it possible to skip the translation step, directly uploading a SVF project (for example, one of these: https://forge-rcdb.autodesk.io/gallery) and loading into the web viewer?
I haven't been able neither to do it nor find any documentation yet.
Yes, that is possible. Instead of loading the Model Derivative service "manifest" using the Autodesk.Viewing.Document.load method, and then loading a specific "viewable" from the manifest using the Viewer3D#loadDocumentNode method, you can just call the viewer's loadModel method and provide an actual URL to your SVF file.
Note however that the Forge Viewer assets (JavaScript, CSS files, icons, etc.) should still be coming from the Autodesk domain. In other words, we do not officially support running the application offline. If you need to support workflows where your users could be temporarily disconnected from the internet, please refer to https://forge.autodesk.com/blog/disconnected-workflows.

How to query for TimeLiner data from Forge API?

I used the TimeLiner plugin for Navisworks to create a 4D timeline. I'm now trying to grab this TimeLiner data from the Forge API. When I log into BIM360, I'm able to load a model into the viewer and see all TimeLiner information within a browser. However, I don't see how I can accomplish this with the Forge API. Is there an available API for this? Or is there another way to grab this info?
Unfortunately, the Timeliner properties are not extracted by Forge service (which BIM 360 is running on), and also some other properties. This blog tells in detail:
https://forge.autodesk.com/blog/updates-navisworks-nwd-translation-engine-coming
Currently, we do have an advanced option to override default configurations to tell NWD/NWC translator if it needs to translate Timeliner properties. BUT, this option is about Forge Model Derivative API ONLY.
While in BIM360 Docs UI, there is no any plan to expose options to let users override default configurations when they upload files. So for now, users uploading NWD/NWC files to BIM 360 Docs will lose Timeliner properties. Consequently, you will have to open those files inside Navisworks to view Timeliner data or take advantage of the Navisworks API to extract the data inside Navisworks. We apologize for the inconvenience.
However, we have legged a wish BIMPLT-698 with BIM360 engineering team to evaluate the possibility of adding options for end-user when they upload the model files. You're welcome to track the updates in the future via sending an email quoting this wish id to the Forge support channel.
Note. Triggering your own translation job to override your desired translation configurations via Forge Model Derivative API on files uploaded to BIM360 will charge you for cloud credits. You will have to consider the extra costs if you want to do so, and see here for the pricing: https://forge.autodesk.com/pricing

Exporting ifc file from revit file in Forge using specific settings

Looking up online I only found a way to export a Revit file to IFC using the settings inside the Revit File already.
Is there a way to export an ifc file from a Revit model using a specific settings (not the settings inside the Revit model)?
(For example, exporting to IFC4 with 1st level boundaries)
Inside a Revit file there is an option to export settings and then load them.
Is there a way to use this settings file automatically on a different Revit file that does not contain this settings?
I assume the export you refer to is built in to the Forge translation system, cf. Supported Translation Formats.
In that case, I do not believe that you can modify the standard settings.
However, you could achieve what you want using the Forge Design Automation API for Revit instead.
In that case, you could implement a .NET Revit add-in that applies the required settings and launches the export.
That add-in can then be re-packaged for use in the Design Automation API framework, for real-time online web access.
Here is an example add-in IfcSpaceZoneBoundaries that I created to retrieve IFC spaces and zones and their boundaries.
For more info, please refer to Design Automation API for Revit or DA4R.

Revit file not supported (while working in A360 viewer) but IFC is working

For a proof of concept I'm playing around in Postman with the Autodesk Forge API's and I'm doign the following.
authenticate
create & get bucket
upload model (in IFC and Revit) in bucket
translate it
extract meta-data.
With IFC files everything is working like a charm but it's not working with Revit files no matter what I do or which Revit file I try.
I tried 3 of my own Revit files (that do work in Autodesk 360 viewer based on Forge) and Autodesk's sample Revit file Basic Sample Project 2016
I'm wondering if it could be something specific in my API calls that I'm missing.
Below are two screenshots of two calls that I'm doing;
put model in bucket
validate translation giving error with Revit but working with IFC
Hope you can help, because I'm very stuck.