I am messing about with creating a pair of components that can pass data backward (i.e. the component downstream influences a component upstream).
This is how it looks:
Input2 for component C2 gets the number from the slider and passes it on to static class, which is in turn accessed by component C1 to be outputted at Output2.
To achieve this the pair of components have to be solved twice:
First iteration: Get the number from the input of the C1 component and sets it as Output1. The C2 component gets both of the inputs and updates the variable of the static class. The Second iteration is triggered.
Second iteration: C1 component gets the variable from the static class and outputs it as Output2 as well as outputting the Input number to Output1. C2 just outputs the number it got from C1.
The problem I face is for some reason I cannot trigger a Second iteration/solution from within the script. I have tried calling ExpireSolution(true), GH_Document.NewSolution(true) and even GH_Document.ScheduleSolution(), but I cannot get Grasshopper to re-calculate the solution.
Everything works fine is I manually click Recompute in Grasshopper.
Does anyone know why this could be happening?