"Params.Output[Index].Recipients.Count" doesn't update number of connected Wires

rhino6
unhandled

#1

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


(Keyu Gan) #2

Sort of, I don’t get it. Do you mean the out parameter doesn’t update when you disconnects a wire on the output side of the script component?


#3

No, any output parameter:

var cnt = Component.Params.Output[any_index].Recipients.Count;

// Rolf


(Keyu Gan) #4

I’m wondering whether the paremeter doesn’t update when you disconnects a wire on the output side of the script component?


#5

No, parameter count. I have not checked any other values on the Recipients member.

// Rolf