Swapping settings

This definition is for generating visuals illustrating growth of strangler figs over geometry. My Settings reference some geometry, and they contain a bunch of numbers. Wires are hidden.

Now I would like to run the definition for two or three different stages of growth, by varying the numbers and the input geometry. Of course I could use different Grasshopper files for that purpose, but then if I change the algorithm, I have to update all of them. Without making it too complicated, I think the easiest solution would be to create “Settings 1”, “Settings 2”, and “Settings 3”, then rewire them every time. However, rewiring is tedious and error prone. What would be a good solution?

(What comes to mind are PCB design tools, like KiCAD or Eagle. There you can name wires, then combine them into a bus. If something similar were avaible in Grasshopper, I could just connect the bus to whatever settings I want to use.)

1 Like

Hi Felix -

It’s very likely that I don’t understand the issue… why would making different Grasshopper files somewhat solve it?

Apart from that, have you tried making this into a GrasshopperPlayer definition? Perhaps that solves things?

To manage my settings: I could have different settings in each file. But, yes, then if I want to change the algorithm, I would need to update each copy, which I want to avoid.

Thanks, that’s great! However, the issue prevails: How do I manage different collections of settings (numbers + selected geometry)? Also, my defition is not exactly fast on my machine, so it wouldn’t feel like a regular Rhino command.

Hi -

I’m still not completely on line here…
How about saved states? Solution > Save State...

For combinations of specific geometry and sliders, you could have all the geometry in a list and have a slider pick an item from that list?

1 Like

You can use the filter component to choose from different settings. All you need to do is provide structured settings.

That looks pretty good! As far as I can tell, this should do the trick. :smiley:

I see, then I can select between different data streams.

How would you structure the data? A key-value list (hash) comes to mind, but I’m not aware that Grasshopper provides such a data structure.

Depends a little on your inputs. I see you’re using a ton of sliders… you could just copy the sliders and create a list per configuration.

Or bake the slider values as user attributes, retrieve the attributes for each configuration and set the sliders with Metahopper.

Thanks, will keep that in mind as an option!

After realizing that geometry is not stored in a Grasshopper solution state, I combined yours and Wim’s suggetions. Although a bit wordy, it seems to do the trick:

To switch to another state, I would toggle the layers manually in Rhino, and restore a solution state in Grasshopper. The restored state index then automatically causes the filters to select the desired geometry.

With a lot of states, this may become too tedious, but I don’t have this worry at the moment.

1 Like

Hi Felix -

Again, I know I’m not grasping the full picture here, but doesn’t it help to add all geometry into a list (or two) (perhaps from the Geometry Pipeline?) and using a slider (with a state) to select an item from that list?

You can automate both the referencing and baking with Elefront

1 Like

That’s kind of what I’m doing. Geometry Pipeline is a great suggestion, if I could parameterize layer names, but that doesn’t seem possible.

it is possible with Elefront