Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import clr
clr.AddReference("Grasshopper")
from Grasshopper.Kernel.Data import GH_Path
from Grasshopper import DataTree
def nestedListToDataTree(nestedlist):
dataTree = DataTree[object]()
for i, item_list in enumerate(nestedlist):
path = GH_Path(i)
dataTree.AddRange(item_list, path)
return dataTree
@ghost

This comment has been minimized.

Copy link

ghost commented Jun 15, 2016

Great! I found your solution on Grasshopper forum and it worked perfectly for my problem.
Thank you for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.