Use a Local Model file for Online Viewer - autodesk-forge

I would like to be able to use a local navisworks or revit file to be available when using an online viewer app on forge.
I have so far followed the tutorial here - https://learnforge.autodesk.io/#/datamanagement/oss/ that allows me to upload a file for viewing from the client side. I would like to remove the ability to upload from the client side and choose a local file to be viewed instead.
I would also like to know how to remove additional buckets / objects placed from the client side from the side menu (circled in the image)
Thank you in advance!

All our sample apps work like this (e.g. https://github.com/Autodesk-Forge/learn.forge.viewmodels/tree/nodejs):
all the client-side content (html, js, css) is in a specific folder (in case of nodejs samples it's called public)
all the rest is part of the server-side
all the Forge related functionality is exposed to the client-side through server-side endpoints
When the page is opened then the browser fetches the client-side components (1) - i.e. html, css, js files
When needed, the client-side code calls an endpoint on the server (2) which in turn reaches out to Forge (3) and passes back the result to the client
The only client-side part that communicates directly with Forge is the Viewer (4)
If you want to remove some of the functionality presented to the user, you can just remove them from the client-side part (e.g. from the html file)
In the server-side code, you can also combine multiple Forge calls: e.g. create a bucket, upload model file into it from the server, translate the model to SVF
If there are operations you only want to do just once (e.g. delete a bucket), you can also use utilities like https://oss-manager.autodesk.io/ or use this Visual Studio Code Extension: https://forge.autodesk.com/blog/forge-visual-studio-code
If you want to add controls to the toolbar this should be of help: https://learnforge.autodesk.io/#/tutorials/extensions
If you want to add something custom then you can use HTML/CSS/JS in your client-side code to implement those

Related

Local language replacement is not complete

I'm new to Forge, and I would like to build a offline 3d viewer with my server, but the language option is not totally functional, like the screenshot below:
Problem screenshot
The language only in cube is same with the browser configuration (Chinese in picture) , others are all default English words.
All the .js/.css file is stored on server, and if I set the option in Autodesk.Viewing.Initializer({language: '***someLanguage***'}). it's only works in the cube, others are still English.
But if I change the main js file source to AutoDesk's CDN below(other js files still on local server) https://developer.api.autodesk.com/derivativeservice/v2/viewers/viewer3D.min.js?v=v3.3 (both of the versions are same within offline and online), the language will completely be replaced by option and works right.
For reproducing the problem, you can export a model from https://extract.autodesk.io/, then run the download files in a local http server.
In china we got bad connection with oversea server, so I would prefer local storage for better UE, are there some get/post requests should be handled on local, and I missed it?
I tried with language: 'zh-Hans' and worked fine, also tried and Chinese (seems fine). Using Viewer v6. As per license you should be using the .js file from Autodesk hosted URL (i.e. CDN):
The Autodesk Forge viewer can only be used to view files generated by Autodesk Forge services. The Autodesk Forge Viewer JavaScript must be delivered from an Autodesk hosted URL.

Forge Viewer. Retrieving from Revit

I set upp my App to retrieve properties information from Revit, meaning it currently retrieves Constraints, Identity Data, Phasing, etc.. But I want it to retrieve documents, links, images as well.
I created this Parameter to test:
Type Parameter: Image
Group Parameter under: Graphics
Then I added this parameter to an object and uploaded a .png. When I check the result inside the App, only the "Name" of the parameter under "Graphics" appears. No content. Only blank. Is it supposed to be like this or is there anything I could do to make the file upload work?
The best way to handle that at the moment would be to write your custom Revit addin that can connect to Forge and upload your model. When doing so, using the Revit API, you could parse the model properties and store the embedded pictures and documents to your own cloud database/storage.
When loading the model in the viewer, you would load a custom extension that does something alike the blog post you are referring to, connecting to your own database and showing the embedded content.
More elaborated demos of MetaProperties are available here and here with full source code here.
Hope that helps

is it possible to extract the HTML code of a R shiny app such that it can be used without having R?

I´m new to shiny and created an app with some plots. This app now will be used for a presentation and should be easily accesible for other people. So my question is, if and how i can extract the HTML code of a shiny app such that at the end I just have a HTML file with the same stuff which is in my application.
When I run the app in my browser and do "save as" in the browser, the downloaded HTML doesn´t work like the original application.
Thanks for every answer!
Short answer: no. Shiny apps work with a backend, i.e. a server (which can be running locally on your machine) handling requests, doing some processing, and then sending back the update to the browser. So if you save the HTML, it will only capture the current state, and any interactions will be broken.
However, there are many interactive UI output elements in R that only work with Javascript and don't require shiny. Many of them are based on the htmlwidgets package. Have a look at leaflet (for geospatial data / maps), dygraph (for time-series data), plotly (for nice histograms / scatterplots / etc), and crosstalk (for creating cross-widget interactions without shiny).
Also, a great way to share your work are R Notebooks. These automatically generate a browser-viewable HTML file when you save them.

Abobe Air/Flex 4.6 Remote File Viewer

I have a Air/Flex desktop application and I'm trying to create a component within the app that can view files on the web server is is already connected to. It just needs to access one particular folder that will contain PDFs, Images & Word documents. I also want the ability to click on the files and having them open in their default desktop applications.
Is this possible and how would I go about doing this?
It's possible but not with your Flex/AIR app alone. It cannot view files/directories on server by itself but it can communicate with your server via webservices, AMF, or any other back end based service. Typically the back end reads the folder and send this information to your app. Your app can open those files in corresponding app but only if those files are available on disk so your app will have to download them prior to opening them.
Every Application has different needs but I myself usually save anything to a desktop or you can use the App storage container as well. As I use only the desktop I download what is needed OR been asked for, and the visitor has the choice of keeping it or if not needed it gets automatically deleted! this way you can use whatever PDFs, Word, Images etc. use read and write (re-write) as well as creating PDFs on the fly with Images, text etc, and that way a visitor also can print directly at his or her own leisure. regards aktell

Is it possible to access web viewer content in Filemaker Pro?

I am developing Filemaker application that uses web viewer.
I need to access to DOM or Window object inside web viewer control so that I can send some messages(or trigger predefined events) to web page from Filemaker.
So the goal is to make web page inside web viewer control get some data that Filemaker sends at any time. Web page is a local html file of which URL starts with file:///.
Is it possible to do this or is there another way to accomplish this task?
It's much easier to send a message from the web viewer to FileMaker using the fmp url protocol (which you can use to e.g. call a script in FileMaker from Javascript).
You can't send a message directly to the web viewer from FileMaker. Your best bet is to set a variable on a service somewhere and have the web viewer poll that service to see if the value changes.
"This task" is not well-defined, IMHO. What exactly are "messages" or "predefined events"? You certainly can use the Set Web Viewer script step to make the web viewer load another URL at any time you wish to.
Note also that you can use Data URI to load data into the web-viewer directly, without requiring an external HTML document.