Skip to content

Instantly share code, notes, and snippets.

@AndersDeleuran
Created August 8, 2016 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndersDeleuran/6a56897a77a824e4f3382faaa70f84a0 to your computer and use it in GitHub Desktop.
Save AndersDeleuran/6a56897a77a824e4f3382faaa70f84a0 to your computer and use it in GitHub Desktop.
import Grasshopper as gh
def listToTree(nestedList):
""" Convert a nested python iterable to a datatree """
dt = gh.DataTree[object]()
for i,l in enumerate(nestedList):
dt.AddRange(l,gh.Kernel.Data.GH_Path(i))
return dt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment