Feature Request - Dropdown list with Images

Hi Mathieu,

Any updates?

The final components do not yet exist in the plugin, but it is now possible to control the images entirely from Grasshopper (without having to go through a theme file like in my examples above). You can see a tutorial of this beta feature in the file below. Note the JSON building components on the left which will in the future be replaced with ShapeDiver plugin components.

250627_ImageList.gh (17.1 KB)

Hi Mathieu,

I’ve integrated the script into my own project, but I’ve run into some issues. It’s clear how to modify the cards and link them to a specific parameter, for example, “height”, but clicking the cards doesn’t actually change the height. How can I link a value to one of the cards so that it updates the value when clicked?

Thanks in advance!

This is a logic common to all the “dynamic parameters” in ShapeDiver. It is not fully documented yet, because this feature is still in beta. You can see the needed logic in this part of the definition I posted above:

You need to add a Direct Text Input component called “AppBuilder” to your definition. When you include dynamic parameters in a definition, this component will return a JSON object containing the list of dynamic parameters that were updated in the App, along with their values.

In the definition, I added a text panel with an example under the component:

{"fullwidthcards": 1}

You can then use JSON components to parse and extract the value, and send it back to the dynamic parameter definition, thus closing the loop.

We will make the handling of such dynamic parameters easier in the future (i.e bypassing the need to understand and parse JSON structures). For now, if you need more help with your definition, feel free to ask more questions or post it so I can help fix it.

1 Like

Hi Mathieu,

I managed to get one parameter working as expected. However, when I duplicate the code for a second parameter, everything appears fine visually, but clicking the cards for the second parameter doesn’t work.

What could be causing this? I suspect it might have something to do with having two separate JSON files on different lines, but I’m not entirely sure.

Thanks in advance.

If you have several parameters, their values are all sent from a single “AppBuilder” text input, in a single json object. You can check the “Dynamic Sliders Tutorial” on this page to see how to handle multiple dynamic parameters.

If you still have trouble implementing your App, please post a minimal Grasshopper definition showing the issue you are facing.

Thanks for the quick response: i am going to try this and otherwise ill send you the grasshopper definition.

Ill let you know how it went!

1 Like

Hi @mathieu1

I managed to implement this feature (really cool btw). But everytime I click a option, it resets to the first option (index 0). I created a condition to show only a set of parameters whenever a click a options (banana set 1, brocolli set 2, so on and so on).

Also, when I manage to make the index 2 showing the correct parameters, whenever I change them it resets to the first option again, reseting even the parameter set.

Something I’m missing in the setup?

Thanks.

1 Like

Please try to send a minimal definition to help us reproduce the issue. Note that it is important to loop back the value coming from the AppBuilder text input to the dynamic parameters sent in the App, as shown in the tutorial I linked above.

Hi @mathieu1 sorry for the late reply.

Just managed to make it work. Thanks for the example definition!

2 Likes

@matthieu Are the newly released dedicated components for creating lists with images stable enough to use instead of the older method?

Absolutely, you can check and use the second tutorial of the section here: BETA - Tutorial Grasshopper definitions for ShapeDiver

The tutorial is still in the beta section but will move to the inputs section with the next plugin release.