Hi team and @mathieu1,
Is it possible to generate multiple apps from a single model?
Use case for us is, without having to duplicate models, one app for internal sales, one for our distributors, one for the web, etc.
Hi team and @mathieu1,
Is it possible to generate multiple apps from a single model?
Use case for us is, without having to duplicate models, one app for internal sales, one for our distributors, one for the web, etc.
There is already a way to do this, but at the moment it is a little bit of effort, and not yet properly documented. I will explain it below. Note already that there will be a more convenient way in the future, by means of saved states.
Setup in Grasshopper
The setup in Grasshopper is the same for both solutions I am describing below. My suggestion is to add a value list parameter in Grasshopper which allows you to switch between different App Builder configurations. That way, you can in the same model include the logic for all the various configurations you would like to create. Of course, you probably do not want to include this parameter in the App itself, but keep it as an “admin” parameter which can be controlled from the ShapeDiver platform only.
Solution 1: Use a json configuration file.
a) Create json files following the template here: https://appbuilder.shapediver.com/v1/main/latest/iframe.json
Of course, you should replace the ticket and model view URL with the ones from your model. In the initialParameterValues
field, you can specify the value list parameter you use to switch between different configurations. In other words, you can create one json file per configuration.
b) Store this file at a remote location of your choice, it should just be accessible through a public URL with the content type application/json
(this should be the default for most hosting services if your file has the .json extension).
c) Let’s say the URL for the json file is https://www.yourwebsite.com/myConfiguration1.json
. You can then use the App Builder with the following URL:
https:///www.shapediver.com/app/builder/v1/main/latest/?g=myConfiguration1.json . Note that this URL will currently not work because the json file from this example does not exist.
Let me know if you have questions. In case you are not in a hurry, we will in the next few weeks create an easier way to solve your issue.
Solution 2: Use Saved States.
You might already be familiar with ShapeDiver Saved States. They allow to store specific configurations of your models on the ShapeDiver platform, and easily browse and load them later.
In your case, you could create a saved state for each configuration (so one per value in your value list configuration filter).
The last part is the one that is missing. Currently, it is already possible to load a model on the ShapeDiver platform with a pre-loaded saved state. However, it is not yet possible in the App Builder. Once it is, this solution will be a convenient way to handle your use case.
Let me know if you have further questions.
Hi @mathieu1
I tried implementing the first option using the JSON configuration files, but I encountered an issue. The error message I received was “failed to fetch.”
I followed the same JSON layout provided (replacing it with my model ticket and model URL). Do you have any idea what could be causing this problem?
Thank you!
I would need a link to the model and the json file if possible, in order to help you.
I will text you in a private message
There was a mistake in the url from my answer above. It is now corrected.