Grasshopper

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?

Views: 2009

Replies to This Discussion

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.

Attachments:

Djordje

Thanks for your helpful reply yet again. I'll reply with some more questions later 

Cheers,

Anton

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service