I just noticed that Component.Params.Output[Index].Recipients.Count
doesn’t update on connecting or disconnecting wires (on a ScriptComponent) until next solution runs.
This lazyness is at risk of making code like the following code more or less unreliable (if the states of the outputs are more critical than this, but even in this case the info in the “out” Output is not correct. “Fake news” so to speak).
var cnt = Component.Params.Output[0].Recipients.Count;
Print("DEBUG: Fake News = " + cnt.ToString()); // DEBUG
// Print only if something is connected to the output
if (cnt > 0)
Print("Good News");
Input[1].Sources.Count
works though, since that is “upstreams” and so it invalidates the the downstream component.
Tested on Rhino6.
// Rolf