I don’t know whether someone else already came up with this method, it seems like someone should have (as I’m not the smarterst person on this forum) but I couldn’t find another topic discussing this and I have seen quite a number of people to who this might be a lot of help.
Consider this situation, you want to run something, but not always, there might be situations where you do not want to write data to Revit or excel, or simply where you might not to want to run a Python script or something complex in a custom node for the simple reason that it takes a whole lot of time to calculate.
Anyway: this is what I came up with:
What we have here is a graph in which you can decide which function to run and decide so via an integer. Setting the slider to 0 will write the data to excel, to 1 will calculate the Average, setting it to 2 will calculate the Sum and 3 will send through the data. I guess it speaks for itself.
I’m thinking the biggest advantage is the ability to easily avoid writing data while still having the ability to do so.
I would create a custom node out of this but I don’t know how to give one a versatile number of inputs.
Side note: I have not tested this with Python scripts as I just don’t know how to write a decent Python script. Also: if someone else came up with a similar method earlier, please link me towards it.