Is it possible to upload large Revit models (1-2GB) and render faster onto Autodesk Forge viewer? - autodesk-forge

I am currently developing a web application integrated with Autodesk Forge platform. Application is hosted on AWS. Basically, users upload their Revit files, the model is translated and rendered on the viewer, and the metadata is extracted and do some visualization. Small models (upto 200 MB) are able uploaded and rendered on the viewer within 60 seconds. But when I upload a large (1-2 GB) Revit file, it takes more than 5 minutes(which is not a good user experience) to translate and render on the viewer. Is there a way to make this upload and render process faster? What are the factors this translation speed depends on? Is this something to be addressed by optimizing my code? I looked everywhere for a solution but couldn't find any. Please advise.
Thank you!

To make upload task faster, we can make use of resumable upload to upload the big model in chunks parallelly: https://stackoverflow.com/a/70034186/7745569
Note. We're migrating to the direct-to-s3 approach of uploading/downloading files to Forge OSS service, so here are the migration references:
https://forge.autodesk.com/blog/data-management-oss-object-storage-service-migrating-direct-s3-approach
https://forge.autodesk.com/blog/upload-large-file-chunks-s3-signed-url-opennetwork-revit-design-automation
https://forge.autodesk.com/blog/direct-s3-nodejs-samples
https://forge.autodesk.com/blog/direct-s3-net-samples
https://forge.autodesk.com/blog/design-automation-api-using-aws-s3
For viewing performance, I would advice you to check out the svf2 format. It aids to resolved large model performance issues.
https://forge.autodesk.com/blog/update-svf2-ga-new-streaming-web-format-forge-viewer-now-production-ready
https://forge.autodesk.com/blog/model-derivative-svf2-enhancements-part-1-viewer
https://forge.autodesk.com/blog/model-derivative-svf2-enhancements-part-2-metadata

Related

Is it possible to download SVF2 model derivatives for offline viewing?

We are currently translating, downloading and viewing models within our application using the derivatives API, forge viewer, and targeting the SVF format. I am exploring doing the same thing using the SVF2 format but I have found evidence that this is not supported (for various reasons).
https://aps.autodesk.com/en/docs/model-derivative/v2/developers_guide/basics/preperation/
"...This means that SVF2 derivatives cannot be downloaded for offline viewing."
Wondering if this documentation is stale and this is actually possible now, or might be in the near future. I am looking for a concrete answer on this before I explore this any further. Thanks.
Currently there is NO public sample code that demonstrates how to download and view SVF2 in Forge Viewer. Only SVF1.
For SVF2, once you have figured it out (it's not that hard to download the 1000's mesh pieces), you'll need to host these mesh bits statically via the web-socket protocol. Finally, point Forge Viewer to your new host.
Don't forget to cache the viewer3d.min.js file, to comply with the EULA (found in the header). Since it's a cache, you'll need to show that the device can pull this file directly from Autodesk servers, when a cache flush occurs.
That's how I would do it.

Autodesk Forge Viewer loading heavy models VS BIM360 Viewer

We have a large .nwd model (1.6GB) that we are uploading directly to forge. I have hidden some elements in the viewer so only some of the elements are translated in the view to make it lighter. I am still having issues with SVF and SVF2 times to fully load the models on Forge. However I did a test on uploading to our hub on BIM360 and noticed it was significantly faster to upload and also the viewer renders the model a lot faster.
My question: Is it better to directly upload to the OSS on Forge or are there benefits in terms of load and rendering times to take the files directly from BIM360 via the Plugin integration workflow? Note: I am only considering upload and rendering times in this question and not other factors that could be beneficial to the end user.
BIM360 is built on top of Forge and it uses the exact same stack to store, translate, and preview your designs, so there should be almost no difference in loading and performance.
If you do see a significant difference in rendering performance, try the following:
open the model in your custom Forge Viewer app, and run the following command in the browser console:
NOP_VIEWER.model.isSVF2()
This should tell you whether your model really uses the SVF2 format.
open the model in another sample app, for example, https://github.com/petrbroz/forge-simple-viewer-nodejs (there's a branch called test/svf2 that is configured to load your models in SVF2), and see if the performance is the same
This should rule out any potential issues in your app's own code that could be affecting the performance.

What need for an automatic design project? My project is very slow

After showing the house to the forge viewer using a Ravit file, the user wants to modify the contents of the viewer and receive it as a Ravit file again. What function should I use to implement the above?
https://learnforge.autodesk.io/#/
I referred to it.
my project
I make input data and transfer this to design automation and get output file and file to translate viewer (this is 2 minutes).
This process is very slow I want better then this process.
https://www.autodesk.com/autodesk-university/class/Its-Not-Too-Late-Automate-Using-Forge-Design-Automation-Inventor-2021#video
This video looks very fast on work process. How to get fast work process like this video?
Thank you
The Forge Viewer is a viewer, not an editor.
The Forge viewer displays the translated version of a seed CAD model, in this case, a Revit RVT BIM.
You cannot edit or modify the CAD seed file in the viewer.
To achieve such a modification, you have to either use the original modelling software, in this case, Revit on the Windows desktop, or you can use the Forge Design Automation API for Revit.
That is what was used to create the Inventor sample you refer to.
Oops... re-reading your question, I see that you are already using design automation yourself as well. Congratulations on that.
However, there is no guarantee on the turn-around time for this process. The video may very well have been edited to eliminate a waiting period, of the user creating the video may just have been very lucky to achieve a faster turn-around time.
I am checking for you with the Forge team whether they used any additional tricks to speed things up in the video or in the true real-time processing. They confirm:
For Revit, a basic DA job should take up to 30-40 secs for the processing time alone. The derivative job for translation to viewer format could take another minute. So, 2 mins is expected. The sketch it demo video has a timer on the side to indicate real time.

RVT=>IFC conversion of large files often fails using Autodesk Forge

Using the Autodesk Forge Model Derivative API, we've observed that for a few of our customers' models, the translation from RVT to IFC fails, after one or two hours of conversion.
Unfortunately these models are confidential, so they cannot be shared, but they are all above 250-300 MB (in Revit format). Is there a limit on the model size to be converted? I doubt that it's related to the upload itself, or the file being corrupted, because we have no problem with smaller files (~100MB), and all these models can be opened in Revit without any problem. (I've also checked for open source Revit sample models as test models, but they are all below 120 MB.)
Thanks for any recommendation on the subject.
Thanks to #EasonKang's help (and Forge support in general), the problem has been solved since the new release of the Model Derivative API (Autodesk Revit 2022.1).

Render refresh for large models in Forge viewer

I am experiencing slower render refreshing for a model in forge viewer, than for the same file in the BIM360 viewer. I am wondering whether it is possible to obtain the same performance in the forge viewer, and if so, how?
I have been looking through old posts on the subjected, where various settings are suggested.
The function viewer.impl.setFPSTargets, as suggested in an old post from 2018, was tested, but even though less objects visibly refreshed, it was on the expense of the graphical performance during view rotations. The viewer.impl.toggleVizBuffer, suggested in the same post seems to have been removed.
Are there any other options or settings I can test to improve my performance?
The object flickering experienced in the forge viewer can be seen here:
Forge viewer render refreshing
Whereas in the BIM360 viewer, the performance is much smoother:
BIM360 render refreshing
The difference in performance might be related to the new, significantly improved viewing format that Forge introduced not too long ago: https://forge.autodesk.com/blog/svf2-public-beta-new-optimized-viewer-format. BIM 360 has been using it for some time now.
If you'd like to give it a shot yourself, take a look at https://forge.autodesk.com/en/docs/model-derivative/v2/developers_guide/notes/.