Load ShapeDiver model with parameters NOT coming from the GH file

Hi everyone,

I wanna build a configurator that opens each time with a different preloaded shape based on some values coming from an App.
So the user does some stuff in this App and then gets access to the configurator. Based on what he has done in the App the configuror shall show a different form in the beginning.
Iwas wondering if I could hand the parameters with which to load the model as a JSON file from the App to the configurator.

The App would provide a JSON like this:

{
“param1” : 100,
“param2” : 400,
“param3” : 500,
“param4” : 100,
“param5” : 100,

}

and then this JSON is parsed in the GH with the ShapeDiver JSON tool.

That’s my first idea how to achieve my goal. But I’m not sure if it’s a good way. I would be grateful for your opinions on that.
Did you already build something like that? Do you know a more elegant way?

Thanks in advance!

You can create initial set of parameters in the JavaScript application, whether randomly generated or stored from previous session it’s up to you. When it comes to ShapeDiver, updating parameters works with the api.parameters.updateAsync() call and this can initiate different parameter values when you launch the App. See more in following resources:

https://viewer.shapediver.com/v2/2.28.0/doc/module-ApiParameterInterface-ApiParameterInterface.html#updateAsync

Thanks a lot, Pavol!