Autodesk Viewer - resources caching on the client - autodesk-forge

I am using autodesk viewer api https://developer.autodesk.com/en/docs/viewer/v2/overview/
We are using Angular/Ionic2 to show the the model in our tablets.
What I observed is the veiwer resources are not cached on the client
eg resources:
objects_attrs.json.gz
objects_vals.json.gz
0.pf
1.pf,
etc.,
How can I cache these resources on the client?

Here is a bubble extraction example (https://github.com/cyrillef/extract.autodesk.io), and its' live demo is https://extract.autodesk.io. This might help you to download the derivative files from the Forge service, then use the viewer under the offline mode.
And you might be interested in this blog article Viewer on airplane mode. It demonstrated some basic scenario for caching derivative files.
Hope this help.

Related

How can I use Audodesk Forge Viewer to view 3d translated model in Autodesk Doc

I am developing My own project to view model from file in Autodesk Docs, but I am really confuse, How should I start from? for now I use 2 legged Authentication and got and access denied.Can someone help me to summarize overview steps to finally my custom viewer can view it?
Overall steps to view forge model in forge viewer.
I'd suggest to start with one of our tutorials, for example:
Simple Viewer - this tutorial guides you through the development of an application that manages the files of its users (designs are stored in a custom OSS bucket owned by the application)
Hubs Browser - this tutorial might be better for your use case as it builds an application that can access designs of its users in other APS applications such as Autodesk Docs, Autodesk Construction Cloud, or BIM360

View Recap Pro Projects in Forge Viewer

I have just discovered a new function that I have been waiting for for a very long time.
It is now possible to publish Recap Pro projects to the cloud for viewing and annotating. Demo
if I have seen it correctly , its atm only possible in BIM360 Docs, but here the Forge Viewer is used.
Now my question:
When will this function be made available to me as a developer?
BIM 360 Docs is built on top of the Forge Viewer, it should be already available for you to translate the model and display it in your own application.
Something you might want to try is to upload the RCP file to BIM 360 and then get the URN from there to pass it to your custom made viewer, so it takes care of the needed setup for translation.

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.

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...

Embed the Autodesk Viewer in a web page

In our web application, we want to view AutoCAD files using Autodesk viewer API.
As per our requirement we want to select the file and need to open directly in auto-desk viewer site, where all default options like 2D, 3D views are available.
Is it possible to view those files, directly in Autodesk viewer, instead of creating our own viewer?
We do have a minified online viewer that takes a svf - pls make sure all svf assets are available at the same location and open to public access with CORs allowed:
https://autodeskviewer.com/viewers/latest/viewer3d.html?svf=url/to/your/svf (make sure to put in the url to your svf)
But this is NOT an official setup of any sort and is subject to change w/o notice. You are very much encouraged to develop your own, just a few lines of code would do this trick if you already have your models extracted.
Here's a few good places to start:
https://forge.autodesk.com/en/docs/viewer/v6/tutorials/basic-viewer/
http://learnforge.autodesk.io
Tools:
http://models.autodesk.io
https://extract.autodesk.io/