Puzzled by iteration in GH Python components

All GH components are “intelligent” in the sense that they try to detect what is being input and adapt themselves to suit - thus you can feed most components a single item, a list or a tree and the component itself will create the implied loops and output the result as an object, list, or tree…

The python component works the same way, so you are best off writing the script as if it was only one item to process and let it create the loops itself if you feed it a list. You can write your own loops but it can also be tricky - this has been discussed a few times on the Grasshopper forum. It also means you might be removing the automatic intelligence of the component and restrict it to only one type of input.

–Mitch

1 Like