How to gey key from Dynamo 2.0

Can you suggestion how to get key??

1 Like

GetKeys

http://dictionary.dynamobim.com/#/BuiltIn/Action/GetKeys

The error is correct :slight_smile:
Dictionaries and Lists are different types in dynamo 2.0

You are using Dictionary.Keys on a list type.

You can use the list counts or list lengths to generate the indices of the lists.

2 Likes

I think it’s a bit of shame that GetKeys on lists was deprecated in 2.0 as it had uses that aren’t fulfilled directly by the new dictionary nodes (as far as I can see—I may be wrong of course!) such as quickly getting the indexes of a list for when I wanted to later reassemble them after boolean filtering and stitching back together again.

Anyway, I now use DesignScript when I need that functionality in 2.0:

5 Likes

+1 on both counts. Seems wierd to get rid of List Keys node, but using DS works great, although trickier if list at level is required.

1 Like

+2 the GetKeys function was so useful inside imperative blocks, in particular with if statements.