Grasshopper

algorithmic modeling for Rhino

Greetings,

Does anyone know how I can select or know the value of the highest value in a list of numbers?
I'm sure this is a stupid question for most of you, so I apologize, but if anyone would be so kind, I'd be really appreciative.
Thank you very much

Views: 52594

Replies to This Discussion

That's easy, use a sort list component.

Cheers
plus select the highest item via the lenghtlist component
Using sort, list and reverse list components can always have the first number as your highest value.
image
Attachments:
Thank you very much for your patience,
in my case, I have a list of a few thousand floating point integers, and they are all listed as "item 0" so, when I use sort, I'm not getting a new list.
So I guess my question would be, how do I make a list out of the numbers that constitute a certain "item"?

Thank you once again
You can also use the Bounds component. It will create a Domain that contains all the numbers in a list.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
ahhh thank you, bounds would be a really easy way as well.
However, my problem is still the same, where I have a list where every item is item number "0" and not "0,1,2,3,4..."
So, I guess I'm still trying to take a all the numbers in an item (in this case item number 0) and turn them into a list. ?

Thanks again for all the help
Attachments:
You need to modify the data structure so that all the related numbers end up in the same list. If ALL numbers must be a single list this is fairly easy, all you have to do is Flatten the data. If your data structure contains multiple lists, it can become somewhat to shockingly more difficult. I'll need to see your data structure as a whole to be able to comment further.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Great,

Flattening worked out, I didn't know about this.
Again, thank you very much for your time!

I´m currently having problems with the max/min selection from lists. This seems to be a new problem. I have a simple and flatten list of numbers and want to find the min and max. I have tried both the list order and the bound components, but neither will actually show the highest or lowest numbers.

I´m trying to color surfaces according to slope using the Gradient component. A simple task in the past, but no luck these days.

The list is flat, but I´ve even tried flattening it. I´ve basically tried everything and nothing is working.

Maybe trying inputting your list into the "number" parameter before you try getting the maximum/minimum value?

There is no way Bounds > Deconstruct Domain won't work in that case. Maybe post some image ?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service