Created
August 8, 2016 08:57
-
-
Save AndersDeleuran/6a56897a77a824e4f3382faaa70f84a0 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 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