From the course: Dynamo for Revit: Python Scripting

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Dictionaries

Dictionaries

From the course: Dynamo for Revit: Python Scripting

Start my 1-month free trial

Dictionaries

- [Instructor] In Dynamo 2, dictionaries were introduced to provide data structures in Dynamo that allowed for key value pair relationships. In this lesson, let's have a look at this type and how it works in Python. I currently have the exercise file open for this video. In here, I've created a dictionary in Dynamo with letters for the keys and points for the values. This type allows us to retrieve the values based on these different keys. The key difference to lists here is that the collection of pairs in the dictionary are unordered as they don't need to be ordered. Items are retrieved by keys. This makes them much faster than lists when retrieving specific data. So with this in mind, let's have a look at how to work with them in Python. Let's go ahead and place a new Python node onto the workspace and plug the dictionary in. Then we'll assign the incoming dictionary to di. To start, let's look at retrieving the data…

Contents