Is there a way to run part of a graph by storing information in a node?

In my graph, I have a python node called ‘dictionary’ (where the cursor is at) which takes geometry and information from the orange groups, before passing it to the blue groups. I was wondering if there is a way to run twice - the first executing the orange groups and storing the data in ‘dictionary’; the second run is from ‘dictionary’ to the blue groups.

The reason I want to do this is that there too many processes which causes Revit to shut down when I run the entire graph. After the first run is done, I’d like to be able to run the second run as many times as I want to debug the blue groups. Any help is appreciated! :slight_smile:

Hi… I’m an absolute novice when it comes to dynamo so apologies if I’m wrong but would the node freeze option be useful here? Select the node, right click and select freeze?

1 Like

Hi, thanks for your reply. However, I cannot freeze an upstream node to run downstream nodes, as everything downstream of a frozen node would be frozen as well.

I apologise for not attaching my graph or showing the details earlier as this for a client, and I am unable to disclose it. Nevertheless, I have attached a simplified .dyn file featuring an upstream group, a ‘dictionary’ and a downstream group, for your testing. Thank you for your help.

example.dyn (8.3 KB)

PS. My question is not specific to my .dyn file. I was wondering if there such a feature (or possible workarounds) that can run large graphs by parts to reduce the strain on RAM.

Hi, the issue at hand is not about the use of Python scripts. I used them because I was handling large amount of data, and that was the best way to organise it, as seen by the complexity of the original post.

Just to make myself clear again, I want to know how, if its even possible, to run graph two times (the first parsing data from orange to ‘dictionary’ then second time from ‘dictionary’ to blue). So that I can work on the second half and rerun as much as I want without having going through the first half.

Just split the graph in two. write the results from part 1 to XLS or CSV and read that info into graph 2.

1 Like

Hi @marcusqwj
As you’ve observed you can put on hold the right part using the freeze option of the nodes.
Then you don’t want to run the left part over and over again, when you test the right part, if I understand you correctly?
For most cases actually once calculated, given no changes are made in those nodes, this is the default Dynamo behaviour. It only calculates if something changed.
If it doesn’t work like that in your case for some reason you can try writing the data from your dictionary to an external file and then copy all the nodes on the right of the dictionary to a new definition and read the data from the external file.

1 Like

Once a set of nodes have been computed, Dynamo doesn’t re-run them unless one suffers any change and then it will be re-run from that node upstream. So if your orange part doesn’t change in between runs, you should be able to freeze the blue side, run once, and then unfreeze the blue and run again.

You can always check the Settings>Show Run Preview Option to visualize which parts of your graph will run.

2 Likes

Thank you, this is definitely a possible workaround I haven’t thought of :slight_smile:

Yes, I was wondering if I could run the left and right halves independently. Thank you for the explanation. I believe the external file is viable alternative :slight_smile:

Thanks, ‘Show Run Preview’ and steps you have listed have been helpful :slight_smile: