so I work on a script where people are allowed to import predefined geometries(dropbox) in a pre defined area. I want them to be in control of how many different geometries they use and where to put them (x&y). So I can’t just put a random number of sliders cause it would make no sense.
First try:
I did give it a try with a “next” button, x,y sliders and c# component to save the slider position. So in case I would come back to a earlier Geometrie the slider would jump to the actual value. Well it wasn’t allowed by shape diver.
Thoughts:
Implementing something like gumball.
having +/- buttons and a c# script with timer.
So perhaps someone has a nice idea to that problem.
thanks
There is no possibility to store state in a Grasshopper model running on ShapeDiver. However you could use the unique „session“ which is created whenever someone starts viewing your model and attach state information to it. This works by using ShapeDiver data outputs, which allow you to output data from your Grasshopper model that becomes accessible using the ShapeDiver Viewer JavaScript API. The data would then need to be fed back to the model as a parameter value (or split into several ones), whenever an update is triggered.
This is a common use case for ShapeDiver, however for now it can only be done by embedding the viewer and using its API to connect the data output back to a parameter.
Here is a tutorial on how to let users input and move around geometry assets in the ShapeDiver viewer:
This is not exactly what you are trying to achieve but it is similar. Instead of the input parameter containing points, you could define one containing URLs of geometry objects uploaded by the user. The JSON object allows you to let users input an arbitrary number of objects, you will just need to define a front-end UI for the users and aggregate the uploaded files in a JSON object.