Grasshopper

algorithmic modeling for Rhino

because it is grafted,so it is more diffcult to find the biggest value......

Thank u very much~!

Views: 1734

Replies to This Discussion

Would using Flatten help ?

Hi Andrea,

 

either flatten the data structure beforehand, or you'll need to make sure the x input has Tree access. Then, you can iterate over all values in the tree to find the biggest one.

 

private void RunScript(DataTree<double> x, ref object A)
{
  double max = double.MinValue;
  foreach (double val in x.AllData())  
  {
    max = Math.Max(max, val);
  }
  A = max;
}

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service