Remote Variables Calling within GH

Hi All,

I think it could be useful to have the chance to define variables at the beginning of the canvas, and be able to call them while v-scripting. Sometimes one value from a slider at the beginning of the definition gets repeated 20 times, and though i know the option of Hiding the wire, each time a new component needs that value, you need to scroll back all the way to the slider and connect it.
I attach two simple idea of what i mean, one defined simply by a panel (or a new component), and the other reading from the slider itself. Sort of a similar to coding that wherever you are you can call a certain variable.
Maybe a very simple Python script could solve this by making it read a specific character in a panel (“**X=4”) and calling it in another panel for input (“X”) later…

What do you guys think?

Maybe it’s an idea… but I personally would not use it…
You should want to avoid any unnecessary complexity in grasshopper.
Use hidden wires:
hidden%20wire

Thanks Riccardo,
though as it seems easy in a small empty canvas, when the whole spaghetti monster becomes larger, you still need to perform this operation every time by going back to the beginning. Why do you think it will add complexity? I’m guessing it wouldn’t be too hard to make a direct value re-call

There are two features new in GH for Rhino6 which may help with the organisational aspects of large algorithms:

  1. Relays
  2. Data Input/Output

Relays can be used to both position and name specific wires. If a value created near the start of an algorithm is needed far away, consider running it through a relay (or two, or three, or five). Assign a name to the first one so you know what data is being provided. You can also easily branch off from that relay sequence in the middle.

The Data Input and Data Output components basically just write and read data from files. It allows you to break up your single large file into several smaller ones along bottlenecks where only a few wires connect some complex group of components on the left with a complex group of components on the right. By separating out your logic into several files you can also drastically reduce computation times since data is cached on the disk rather than recalculated.

4 Likes

Many thanks David, I came across one video of yours in Dec 2017 where you were showing Data Output/Input component, and I think it’s great.

I think it’s interesting to create a “small library” of .ghdata files depending on the parameters needed to be called and use them throughout the algorithm. I still need to get accustomed to the Relays, i’m sure they have a good potential as well.

Thanks

Lorenzo

FYI These components where introduced here: Can Two GrassHopper definitions communicate?