Created
October 14, 2013 13:11
-
-
Save bengolder/6975370 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great! I found your solution on Grasshopper forum and it worked perfectly for my problem.
Thank you for sharing.