In today's post, Chris Woodward follows Part 1 of our mini-series on Dictionaries in Dynamo to show how a script using Dictionaries can easily be added onto or refactored. If you missed Part 1 and have not yet used Dictionaries in Dynamo, it might be worthwhile going back to it in order to get a quick primer on how they work.
With this workflow, we are able to pass in a list of Dictionaries and a series of inputs from sliders that the user sets at the beginning of the script as a single input node, modify those values based on a “program” value from the dictionary, then set those values back to the list of dictionaries at the end. It is a simple, encapsulated logic flow that does not require the management of a large number of lists throughout the script.
A similar logic is used by this grouping. We are easily able to move this portion of the script to another location because of the single input and single output. The simplicities of the input and output mean that we do not need to spend time figuring out how to rearrange lists and connections. Instead, we can just plug and play with the rest of the script because we are only ever inputting and outputting lists of dictionaries.
About the Author