To Translate a Drop-Down-Selectable Node to Code

I’m currently working on a script to export Schedule data into Excel.
My “Schedule Filter Type” Node will sporadically turn the dreaded Red color and the Drop-down selection will return to a blank state. When I then select an option from the Drop-down menu, it still remains red and will be therefore useless. I am then resorted to deleting that node and placing a new “Schedule Filter Type” node, which will then work correctly until it too eventually “fails” like its preceding brethren.

My inquiry is as follows: Is there a what to write in DesignScript or Python, a line that consistently and reliably outputs only one of the Drop-down selections from that Node?

My the nature of my script requires that node to only ever specify the “Contains” FilterType, and I just want to solidify that output.

you can replace it with
Code Block =“Contrains”
Capture

Thank you so much, that works perfectly!

I’m not sure why but I had it in my head that using strings would not work properly. I’m recreating the script in 2.0.3, so maybe that doesn’t work in Dynamo 1?

Nevertheless, thank you!

actually script 2. will not work in 1., the reverse yes

1 Like