musikerz 发表于 2016-6-24 13:22:22

Python List into Grasshopper Tree

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
from clr import AddReference as addr
addr("Grasshopper")
from System import Object
from Grasshopper import DataTree
from Grasshopper.Kernel.Data import GH_Path

def raggedListToDataTree(raggedList):
    rl = raggedList
    result = DataTree()
    for i in range(len(rl)):
      temp = []
      for j in range(len(rl)):
            temp.append(rl)
      #print i, " - ",temp
      path = GH_Path(i)
      result.AddRange(temp, path)
    return result

wu332 发表于 2016-6-24 13:39:39

上面是什么代码?

无忧 发表于 2016-6-24 14:31:55

wu332 发表于 2016-6-24 13:39
上面是什么代码?

Python 语言

musikerz 发表于 2016-6-24 15:22:39

学GH必学Python

abc01 发表于 2016-7-15 20:37:36

謝---------------------
页: [1]
查看完整版本: Python List into Grasshopper Tree