Run Only Part of a Script

Hello All,

I am wondering if there is a way to run only part of a dynamo script? I know you can freeze nodes.

I have a script that draws some lines but I do not need it to always draw all of the lines. Is there a way through an If statement (or something) to freeze a node? I have the logic for when it should not be drawn but do not have the method other than passing it a Null or an empty list. I tried doing this but Element.SetParameterByName gives me and err “Warning: Internal error, please report: Dereferencing a non-pointer.” It does what I need it to but I do not like getting warnings.

Thanks for any help,

Hi,
I don’t think you’ll get much help with the amount of information that you’ve provided. If I understood you correctly, then the answer is yes. You’ll just need to figure out how to restructure your graph. Here’s an example that creates only 10 lines if today is Tuesday. Otherwise, it creates all of the lines:

Sorry Dimitar,

Some times I think I am a little more clear than I am.

As I was finishing my reply I realized a much better way to write this. Thank you Dimitar for helping me get there by forcing me to further explain what I was doing. Since some of the lines will always be generated I combined them into a single list preventing the warning from a empty list. I do not know why I was running them all separately to begin with.

Solution

below was going to be my response encase anyone wants to know my problem and how I solved it.
hv and x in the code blocks are Boolean inputs. In the top graph a line will be created every time however in the bottom one a line will only be created if each Boolean is true. Is there a way to prevent Element.SetParameterByName from creating a warning when it is giving an empty list?

Thanks again Dimitar and sorry for wasting you time,