algorithmic modeling for Rhino
in_1.MergeTree(in_2)
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks for your reply.
It's my first time to use "Tree Access". So... how can I get the output? in_1 is Null, a = in_1.MergeTree(in_2) is Null...
I don't get it. If you have two non-null DataTree instances and you want to merge them, use the MergeTree() method. If you only have one DataTree there is nothing to merge.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Well, the two trees each has 2 branches. I want the final tree have 4 branches. The MergeTree() will make the final one 2 branches with each double the children's number.
Though I use other method to accomplish the goal, I still want to here you advice.
Ok, so you want to combine all lists in all trees and change the paths so they don't collide. In that case you're better off just making a new DataTree and appending the lists inside loops:
Dim tree As New DataTree(Of Object)
Dim idx As Int32 = -1For i As Int32 = 0 To x.BranchCount - 1
idx += 1
tree.AddRange(x.Branches(i), New GH_Path(idx))
NextFor i As Int32 = 0 To y.BranchCount - 1
idx += 1
tree.AddRange(y.Branches(i), New GH_Path(idx))
NextFor i As Int32 = 0 To z.BranchCount - 1
idx += 1
tree.AddRange(z.Branches(i), New GH_Path(idx))
Next
Where x, y and z are DataTree<Object>
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Though I try to avoid using DataTree, this seems to be the easiest method.
Thanks for your time.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by