Grasshopper

algorithmic modeling for Rhino

i was figure out how to emulate the Grasshopper Component Graft, but inside Python 

the info its not to clear for me i dont know exactly wich libraries i have to import to the Script and how the function work 

anyone can drop a bit of light to my research ? 

Views: 2967

Replies to This Discussion

for example if variable treeA is Object of Tree then just...

treeA.Graft

humm i dont understand your example 

Exactly what i want its Graft The Splited List but inside Python 

here's the link of the Code : CsvManager

Or maybe this? if you want to instantiate GH Data tree within the script.

and the code:

import Rhino
#import grasshopper classes
import clr
clr.AddReference("Grasshopper")
from Grasshopper.Kernel.Data import GH_Path
from Grasshopper import DataTree

newlist = []
newlist = x[:]
print newlist

graftedTree = DataTree[object]()
for i in range(len(newlist)):
str =newlist[i]
path = GH_Path(i)
graftedTree.AddRange([str],path)

A = graftedTree

Best,

M.

Hey Mario Thanks a lot 

the program now its working well with your code

Link of the Component Code Here:

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service