Putting five scripts into one single file

Hello everyone,

Long story short, I’ve made five scripts that tests the revit model. Instead of having all five scripts in one file, a person needs to open 5 different dynamo scripts in order to test it.

The initial reason why I did it in that way is because Dynamo environment wasn’t as forgiving as Grasshopper where you can have multiple scripts in one file but control them by turning off / on the entire script easily.

I learned that you can turn an entire script into a node.

Here is my idea and it would be very appreciative if the experts here can give me some advice.

"Function #1 - (0.00 - 1.00)
|
if(x !>= .70)
STOP
return FAIL
else {
CONTINUE
}

FUNCTION #2 - (0.00 - 1.00)
FUNCTION #3 - (0.00 - 1.00)
FUNCTION #4 - (0.00 - 1.00)
FUNCTION #5 - (0.00 - 1.00)

if( #1 PASSED && 2, 3, 4 || 5 PASSED)
this passes"

Is there a way where I can place all five nodes (scripts) in one file and run it similar to the code structure that I provided above?

Please let me know if you have further question.

Thank you very much for your time.

You can’t really prevent nodes from running. Your best bet is to run them all and then use a nested IF statement to return the proper output based on the outcome.

thank you for your input. that also makes sense.

is there a way where I can combine IF statement with a big color block where if its passed then its green, if not, red. Please take a look at the image below. <-- this is just to clearly indicate if the script has been passed or not.

thank you!

You could draw up some geometry and color it based on an IF statement.

You could leave the nodes as a function. Then use a toggle to either return the list of items to run the function on or a null value. Then use a function apply or list.map node to apply the functions to the null value (which should return a null value without causing an error) or the resulting data (depending o the boolean toggle).

1 Like