SOLVED: Create Data Structure w/ Panel Name (Combining Nickname with Dynamic Input Value via Python)

I’m looking for a good way to combine data streams into a logical output (I’m sorry if that description is too vague, but I hope it’s evident from the screenshot what I’m trying to achieve.) I believe I only need to replace the highlighted code with something like “s.Value” in order to get values from each of the inputs?

Thanks for any help you can provide. I can find my way around rhinoscriptsyntax, but this stuff is over my head :roll_eyes:

Alternate methods also welcome.

Current code:

info = []

for input in ghenv.Component.Params.Input:
    for s in input.Sources:
        ### edited code
        attr = s.Attributes
        if (attr is None) or (attr.GetTopLevel is None):
            component = attr.GetTopLevel.DocObject

a = info

Hi Steven @senorvalenz

please attach samples if you would like people to try your code.

I think I understand what you are trying to do. In general, reproducing value evaluation is very difficult, and should be Grasshopper’s task. It’s better to let Grasshopper compute, and create data with what is given. For example, this way will work: (12.9 KB)



Giulio Piacentino
for Robert McNeel & Associates

Thanks for your reply Giulio, and sorry I wasn’t more clear. I’ve clarified my goals with a screenshot and attached my Rhino and Grasshopper files. Does that make more sense? Please pardon the mess, it’s very much a WIP!

GrasshopperSandbox.3dm (66.1 KB) (59.9 KB)

I think this produces your desired outputs: (8.4 KB)

Script raises an exception if all inputs are not the same length and gives a warning if inputs are not set to “Tree Access”.


This is perfect, thanks so much Kevin. I’ll have to dig into the code more closely to see how I can improve my future scripts. :pray: :pray: :pray: