BIM STUDIO

标题: Python List into Grasshopper Tree [打印本页]

作者: musikerz    时间: 2016-6-24 13: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[object]()
    for i in range(len(rl)):
        temp = []
        for j in range(len(rl[i])):
            temp.append(rl[i][j])
        #print i, " - ",temp
        path = GH_Path(i)
        result.AddRange(temp, path)
    return result

作者: wu332    时间: 2016-6-24 13:39
上面是什么代码?
作者: 无忧    时间: 2016-6-24 14:31
wu332 发表于 2016-6-24 13:39
上面是什么代码?

Python 语言
作者: musikerz    时间: 2016-6-24 15:22
学GH必学Python
作者: abc01    时间: 2016-7-15 20:37
謝---------------------




欢迎光临 BIM STUDIO (https://bbs.bimst.com/) Powered by Discuz! X3.5