That’s because a “dictionary that is passed as output from a component will be seen as enumerable … This means that only the keys will be resolved” i.e. only the keys are output:
Hi guys
I’d like to shed some light on this. So that you know why things are working this way. Please keep in mind: besides reasonable Python programmer goals, while using GhPython we are in Grasshopper land and are using all facilities that come from IronPython.
So, things to keep in mind:
A dictionary that is passed as output from a component will be seen as enumerable and will be enumerated. Grasshopper needs enumerated objects, and GhPython buffers results for Grasshopper when it sees t…
You can output and pass a full dictionary using this “hack”:
Another simple GHPython solution (i.e. sending arbitrary structured data from one GHPython component to another) is to structure the data in a Python dictionary (i.e. key/value), wrap that in a list/tuple and output that, it’ll pass as an item along the wire, so set the receiving component input parameter to Item Access and No Type Hint and the data will go right through maintaining its structure:
[2018-07-25%2012_32_15-Grasshopper%20-%20180725_PassDict_GHPy_]
180725_PassDict_GHPy.gh (3.6 K…
2 Likes