algorithmic modeling for Rhino
I have a datatree entering a python component it could have any number of branches I want to flatten this datatree just like when you right click on the panel inputs and click flatten except that I want to do this within python.
I understand that I need to use the DataTree method Flatten but I'm not sure how do to use it. Does anyone have any sample code?
Tags:
Hi Anton,
Flatten method flattens the data tree in place. So afterwards you just have to assign it(the data tree) to some ghpython component's output parameter.
If you don't want to choose the final path of the flattened tree (have it always be {0}), then just do not supply any other argument to the Flatten method, except data tree itself (dataTree.Flatten()).
Check the attached file.
Djordje
Thanks for your helpful reply yet again. I'll reply with some more questions later
Cheers,
Anton
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
© 2024 Created by Scott Davidson. Powered by