Grasshopper

algorithmic modeling for Rhino

Hi all,

I am encountering a very basic issue when trying to access the first item of the first branch of a data tree in C#. Can anybody tell me how to do that?

I have been trying to call it by entering something like

DataTree.Branch(0)

and expecting to find something like Item in the next tab, but nothing similar comes up.

Any tips or suggestions would be appreciated!

Thanks a lot,

Ana

Views: 5876

Replies to This Discussion

DataTree.Branch(0) will return the list of first Branch.

If you want to access item, you need...

DataTree.Branch(0)[i]

i = index of item in the list.

GREAT!!! Thank you so much!

Hi to everybody,

I am trying to do the same as y.KWON, but I'm currently using GH_Structure<> class to organize the data tree

I was able to build and organize the data tree, but now I am a little bit stuck on retrieve a certain item from a defined branch.

How is the syntax?

I am trying this one, but Visual Studio highlight an error:

GH_Vector isNxxMagn = new GH_Vector(mechAnalysisData.Branches(0)[i]);

thanks for your help

matteo

I solved it:

this is the syntax:

GH_Vector isNxxMagn = new GH_Vector(mechAnalysisData.get_DataItem(mechAnalysisData.get_Path(0),i));

cheers

matteo

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service