ShapeDiver update multiple parameters in direct embedding approach

Hi ShapeDiver team,

I am developing a website with a shapeDiver model embedded.
I would like to access grasshopper parameters and update them through the website interface.


At the HTML file, I have two range inputs, one for controlling the width, and the other one for the length.

In the shapeDiver model loader js file, I created two separate functions to update the parameters through the API.

Parameter names have been double-checked that match with the grasshopper component names.

The issue is there is an Uncaught reference error when I move the stair width slider that is shown at the first picture which points to the HTML file line 71 where I set two input ranges and control them in js file.

Best,
Shaun Wu

This code example shows you how to generate UI from model parameters for direct embedding:

I hope this helps and let us know if you have any questions.

Hi Pavol,

I checked this example already.
It doesn’t work if I have multiple input sliders to update.

We have updated the code example and it has 2 sliders now. Please have a look and if you still struggle share a CodePen or a minimal example so we can help you to debug.

Hi Pavol,

I made a simple example for it.

It is working perfectly on the CodePen, but if i try the same code in my local host, i got the same Uncaught reference error.
Weird.

Hi Pavol,

It turns out that my local host HTML was pointing to the wrong file.
It is nice and running as expected now.
Thanks for your supports.

Best,
Shaun