Grasshopper C# VS, send data backwards?


Is it possible to have the inputs of a connected component change when connected to different components, i.e is it possible to send data backwards rather than forwards.

For example;
I have a column design component that takes in geometry data and force data from two different components, so 3 components total. I want to be table to change the inputs of the force component when the geometry input changes (from say rectangular section to circular). So the flow of data would be geometry components > design components > force components, even though the geometry and force components are both inputs to the design. Is this possible?


A does something and then inputs something to B, C . These do something else and store some data (say: usefull to A) to parameters accessed by nickname (i.e. volatile to persistent data). Meaning that these data holders shown are not connected to anything.

Each time that B, C are triggered to run they keep updating (or replacing or whatever [say via some user control: store, not store etc etc]) the data in the data holders (DataFromB, DataFromC - but better pick some proper nicknames).

It’s your responsibility to tell A to read [or not] from these data holders - if not empty - each time that re-executes (by also accessing them via their nickname). Obviously bananas may happen if some sort of management/logic is MIA.

For instance:

A computes frame axis for some envelope in some building IF a solution is valid (alu extrutions, cost etc) OR if no validation(s) report(s) exist (i.e. data holders are empty).

B, C, … Z do some “detailed” work (maybe FEA as well) and report (i.e. store) the status/rate of the solution (per solution variant [global history], per frame per specific alu series [local history]). Then A reads the news … etc etc.

You’ll need some - more or less - robust control on what to store, where and how to get rid of things that you don’t need. DT’s are handy for that scope, mind (you can have some sort of history control that way). NOTE: Avoid DataTrees if you have a BIM aspect of things in mind (meaning that R/GH play just a small secondary role in the whole pipeline, meaning that the data should be as GH neutral as possible).

Your case doesn’t need data backwards. Your goal can be achieved by components “stream filter” and “stream gate”.

As I am creating the components in C# within visual studio, is there not a way to do this within the code?

WIthin the SolveInstance(IGH_DataAccess DA) section where I can set the .Name and .Nickname of inputs based on data that is being send backwards from the main component

Hmm, maybe you want only some simple iteration? As far as I know there is no easy way to move it back. Even if there is some option I’d probably go with one component where inside there would be that iteration loop for your purposes anyway.

I don’t work with VS (the from/to thingy breaks my nerves - but the build in editor breaks my nerves as well). See a small hint on that matter:


please beware yourself from that idea. It’s a terrible one! Inside a function/routine/method you code from top to bottom, and except from loops you don’t want to “goto” up again! Sure, sometimes you need recursion, but that usually only applies to graph-alike data-structures and can be achieved by recalling itself. Why on earth would it be a smart to do it differently in Grasshopper? I tell you there is rather a flaw in your concept, then this being a limitation of Grasshopper!

True … if we have a simple C# (say 100 to 1000 lines) where things happen as things happen. However what if the Methods are many (“sampled” into several C#’'s going from “abstract” to “doable” etc) and you want some sort of access from/to common pools of things/data? (like validation scores for something or a myriad other stuff).

That said hard ro interpret that type of “access” as a big goto thingy (or an enormous one).

Other than that, the serious Q: what about an used AH64-A ? (they deliver it in black as well if you pay in advance).

1 Like

When I see all these things that you do inside this C# script editor I still cannot believe it how much patience you have. VS is also annoying, but at least Rider works for me. For prototyping GHPython is a bit more convenient. For me C# scripting inside GH is only for Tibetan monks.

1 Like

Well … it’s kinda pulling a double forward (that’s a wave windsurfing loop - handle with care [Karma a must] ): appears impossible but after a while becomes second nature. Anyway I don’t use R/GH in any real-life workflow … so it’s exactly like the forward thingy.

1 Like