Pass input of mixed type into a Hops component

I’m trying to use Hops components to compose data of mixed type into lists where each index in the list corresponds to a key, similar to ordered dictionaries. I should also be able to decompose the lists into the original data.

Composing the list is easy enough, as I can use the Data parameter component as the output. I’m not able to work out how to do the decomposition, however, since there isn’t a generic Get Data component that can take inputs of mixed type.

Is there a workaround for this? I have also tried using Python to compose the data into IronPython.Runtime.PythonDictionary types, but these are turned into null values when passed into Hops components too.

test-get-properties.gh (12.1 KB)
test-set-properties.gh (10.8 KB)

After stepping away from this question for a couple of days, I had the idea of using Data Input/Output components to pass data into and out of Hops components, with the following goals:

  • Data Input/Output components can handle lists of mixed types, IronPython types like dicts, custom types from plugins etc. so it allows me to bypass the restrictions on input types for Hops components;
  • Data Input/Output components can handle data trees so it adds “Datatree Access” equivalent functionality for Hops components;
  • Data from GHDATA files is only pulled into a definition/the Data Input component when the definition is active/open in Grasshopper, but (my hope was that) Hops components are run as part of the GH solution so it would trigger the data fetching automatically without needing to open the file.

Alas, this didn’t work out. I’m not entirely sure how the sequence of components plays out now in the Grasshopper solution. When it runs a Hops component and that Hops component contains a Data Input component, does it just ignore it? I’d appreciate it if the wizards on this forum could enlighten me about the inner workings of Grasshopper in this regard!

1 Like