Hello,
I tried to create a data tree with C# in Grasshopper. Here is my code:
Grasshopper.DataTree<object> tree = new Grasshopper.DataTree<object>();
Rhino.Collections.RhinoList<int> subtree1 = new Rhino.Collections.RhinoList<int>();
Rhino.Collections.RhinoList<int> subtree2 = new Rhino.Collections.RhinoList<int>();
subtree1.Add(10);
subtree2.Add(20);
GH_Path path1 = new GH_Path(1);
GH_Path path2 = new GH_Path(2);
tree.Add(subtree1, path1);
tree.Add(subtree2, path2);
r = tree;
But it doesn’t work. This is what I get: