Multiple data stream into ghpython component

ghpython
python
unhandled

#1

I’m working with a set of closed ranges in grasshopper that I need to feed into a ghpython component. However, it appears that having multiple connections into a single input for the python component causes it to ignore any other connections. (Basically in python I would be working with a list of lists). Does the grasshopper python component only allow single objects to be fed into the component (thus I would need multiple outlets?)


(Tom) #2

Hello,

rightclick onto your limits parameter and set to “list” or “tree” access.


#3

Also:

Zoom further in to activate the ZUI-functionality, allowing one to add/remove input/output parameters by clicking the +/- buttons that pop up.


#4

I know I can do this, but I’m trying to design the component to have a variable number of domains :slight_smile: The python script will then find the union of the domains, so if I was doing this in python, each domain would be a list, and my function would act on the list of lists.


(Tom) #5

Input = intervals as list of type Interval

import Rhino.Geometry as rg

import sys

min = sys.float_info.max # pos. infinity
max = sys.float_info.min # neg. infinity

for interval in intervals:
    if interval.Min < min:
        min = interval.Min
    if interval.Max > max:
        max = interval.Max
        
Union = rg.Interval(min,max)