Hi,
I am trying to get Data Tree with custom paths. For instance, I have 5 points and each of them are named with a number(2,2,3,4,5) I want to get output as seen below:
import rhinoscriptsyntax as rs
import Grasshopper.DataTree as dt
import Grasshopper.Kernel as gk
import Rhino as r
import scriptcontext as sc
sc.doc=r.RhinoDoc.ActiveDoc
plist=[i for i in x]
tr=dtr.Geometry.Point3d
a=[tr.Add(i,gk.Data.GH_Path(2)) for i in x]
sc.doc=ghdoc
I tried “treehelpers” and I could manage to get trees out of the lists, however I am trying to use rhinocommon to enlarge the manipulation possibilities over the trees. I have read those documents you suggested, thank you very much for that, but I could not manage to succeed. I don’t know where am I doing a mistake on this code.
I think your issue is when you are assigning the output variable a. As the DataTree.Add() method does not return anything, in line 20 you are assigning a to a list of None.
You’ll want to use the tree itself as an output of your component, or assign a = tr.