Iām using the Dictionary.ByKeysValues node in Dynamo to combine a list of string keys and a list of values. My intention is to display the result in an ordered manner in the Dynamo Player (by marking the Watch node as an output).
As you can see in the attached image , I connected my keys in the order:
- āError en la entrada Nro. 3 (BORDES COMPLEJOS)ā
- āHora Inicialā
- āHora Finalā
- āTiempo Total de ejecuciónā
However, the resulting dictionary in the nodeās output and in the Dynamo Player is shown with the keys out of order (for example: ā2. Hora Inicialā, ā4. Tiempo Total de ejecuciónā, ā3. Hora Finalā, ā1. Errorā¦ā).
I tried using an OrderedDict inside a Python Script node, but when trying to pass it as an output to Dynamo or the Player, it seems the Dynamo Dictionary still isnāt an ordered data type, or the Player handles it as a standard dictionary.
My questions are:
- Why does this lack of order occur? (I understand that dictionaries are, by definition, unordered collections in Dynamo and in many Python implementations, although modern Python keeps them ordered, Dynamo seems not to).
- Is there any way to force the order of the dictionary so that the output in the Dynamo Player displays the keys in the same order I originally provided them?
- If a dictionary cannot be used, what would be the best alternative to display this grouped and ordered information in the Dynamo Player?
The goal is to have a final output in the Dynamo Player where the labels (keys) and the corresponding values are displayed logically and sequentially.
Any help or explanation on how Dynamo handles this would be greatly appreciated!
