algorithmic modeling for Rhino
Hi Dimitry,
and when you say "path" what exactly do you mean? You want to sort the numbers that make up the path indices, so that {0;0;1;0} becomes {0;0;0;1} ?
Or do you want to sort data inside the branches?
If the former, then no, paths aren't supposed to be mutable, meaning you're not supposed to change paths that are already part of a tree. You can create a new tree and supply paths that have been sorted.
--
David Rutten
david@mcneel.com
Barcelona, Spain
Hi David,
Thanks for the rush reply.
I want to have an opportunity to sort data in tree branches, as it possible with lists or arrays, without to resave these.
something like this:
sort data in tree(path{0,0,n})
foreach (path in tree):
if smth:
sort tree (path)
else:
reverse tree (path)
Is that possible?
Best
D
There is no default comparer for data inside Trees, so you'll have to supply that. Are you doing this on GH_Structure(Of IGH_Goo) or DataTree(Of Object)?
And, can you say anything about the data inside the tree (what type, can there be nulls etc.)?
--
David Rutten
david@mcneel.com
Barcelona, Spain
was using DataTree(of double). but it could be int or point3d
Actually I already wrote a loop for saving a branch into a list and back, so no worries about that. If it will make sense please add function as sort or reverse, if not it is also ok.
Thanks
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