Autodesk Forge "View BIM 360 & Fusion models" sample - autodesk-forge

I'm just starting with Autodesk Forge, and I'm trying to follow "View BIM 360 & Fusion models" sample on https://learnforge.autodesk.io/#/tutorials/viewhubmodels.
The tree correctly shows the hubs, projects, files and versions.
However, when I pick some version the viewer don't show that file.
I also tried to download directly from GitHub (https://github.com/Autodesk-Forge/learn.forge.viewhubmodels/tree/net), but same thing happens...
Tried with .rvt and .pdf.
Any kind of configuration that I'm missing?
** Update **:
I've debug the code and found:
DataManagementController -> GetItemVersions gets urn value;
for that versions, launchViewer(urn, viewableId) gets "Error: 403 (Unauthorized)"
viewableId is undefined
I am looking at .rvt and .pdf files...
I am missing any configuration? Any clue?
Regards
António

Solved!
The Viewer needs access to Model Derivative API.
Ensure it is properly configured on your Forge API.

Related

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.

Reliably Determine Revit Version of BIM 360 Project

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.

Does Autodesk recommend offline forge viewer?

Does Autodesk recommends offline forge viewer?
what is advantages of offline forge viewer over online?
I am referring this tutorial, but struggling with some error as follows:
if there is any working example of offline forge viewer please drop link here.
Thanks in advance!!
Does Autodesk recommends offline forge viewer?
We are neutral on this - there's no recommendation as to whether to load the model from our service or your own ... it's entirely a matter of your business requirements ...
what is advantages of offline forge viewer over online?
There's no pros and cons loading the model from our service or yours ... it really on your requirements such as confidentiality, security (of your Forge app tokens/credentials) and network proximity etc ...
The error you ran into suggests the SVF file could not be loaded so check these:
Viewer only supports http/https and not any other protocols (so URLs starting with file:/// won't work)
See your browser's console output for errors
Make sure you've provided the correct path to the SVF file to Viewer
Post your code if you still have problems so we can look into it...

Autodesk Forge "Failed to trigger translation for this file" (Fusiondoc/F2D)

I can succesfully translate Fusion 360 designs (F3D) using the autodesk derivative api using the urn of the item version. But whenever I try to translate a Fusion 360 drawing (fusiondoc) I get a Bad Request error (400) with the following error message:
Error calling Translate: {"diagnostic":"Failed to trigger translation for this file."}
When i try to open the drawing on thr web using A360 and open it in the web viewer, it will succesfully prepare the file for viewing (takes a while), after which I can also view the translated file sucessfully from my own viewer re-using the same urn.
Does anyone have any experience translating fusion 360 drawings to svf using the derivative api for viewing?
I don't think fusiondoc is supported by the Forge Model Derivative API. Please see the list of supported input/output file formats at https://forge.autodesk.com/en/docs/model-derivative/v2/developers_guide/supported-translations.

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.