Dictionary.ByKeysValues


Dictionaries are an incredibly powerful tool for making associative sets between two equal length lists. The first is a list of keys (or indexes) and the second – a set of values (or the data that will be returned for each index).

DynamoSandbox_2016-01-31_18-43-25.png

Inputs:

  • keys: it must consist of unique strings or numbers.
  • values: a value that will be returned for each key.
  • search keys: the list of keys(indexes) that you want returned.


Manipulate data, sculpt geometry, explore design options, automate processes by remotely accessing your visual programming environment on trending virtual PCs from CloudDesktopOnline.com powered by one of the best DaaS providers – www.Apps4Rent.com.

The dictionary values can hold lists of objects:

DynamoSandbox_2016-01-31_18-58-39.png

Or Revit elements:

Revit_2016-01-31_18-59-53.png

If a search key is not found in the dictionary, an empty list will be returned instead.

Advertisements

One thought on “Dictionary.ByKeysValues

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.