Grasshopper

algorithmic modeling for Rhino

If I have an irregular DataTree like:
{0;0},{0;1}
{1;0}
{2;0},{2;1},{2;2}
...
going into a VB component is there a convenient way to find out how many branches there are for each first digit. For a trivial example, see the image, I'd like something like this in the script component:
For i As int32=0 To 10
  'WANT TO KNOW HOW MANY BRANCHES EXIST
  Dim jLimit As int32 = ????
  For j As int32=0 To JLimit
    Dim currPath As New GH_Path(i, j)
  Next
Next

Views: 879

Attachments:

Replies to This Discussion

Hi Trevor,

 

not sure if it's 'convenient', but the attached file shows one way of finding this information.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:
Thanks, looks better than my hacked way of making a second, dummy Tree with one less dimension, adding a '0' everytime the real Tree added a ranch.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service