Grasshopper

algorithmic modeling for Rhino

I have 2 questions:

1- I've got a list of datas like for example:
3.0
2.1
1.1
0.0
2.1
3.1
4.2

They have been rounded up with one decimal -Round(x,1)-  but I would like to reduce the amount of datas and round them up to .25
like
1.25
1.50
1.75
2.00

or just
1
1.5
2
2.5
3
etc..

How could I do that???

Question 2:

I've got a list of surfaces that has different width and I would like to sort them in a table or just to know how many surfaces have, for example, 2.0 or how many have 0.25, etc and have them all in a list...

Can anyone help me on that?

Thanks so much

Maurice

Views: 1272

Replies to This Discussion

You could multiply the values by 4, then round to the nearest integer, then divide by 0.25.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
They must have given you some good stuff at the dentist...

I think you mean multiple by 0.25 (or divide by 4).
:) Indeed. Anesthetics have long since tapered off, I'm on a strict, self-enforced diet of ibuprofen and whiskey now.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Self-medication: Always the right prescription!
Do you need an actual accounting of your lists or just a visual distribution?

[BarGraph] is the simple answer but I don't think you can extract info from it.

Hi Taz,
Yep I need an actual accounting of my list.

I've tried the visual distribution with the graph but its not enough...
OK,

I take no responsibility for the accuracy or robustness of this code, but it looks like I got a scripted component working...

Attachments:
Wowww man you are a GENIUS!!
Thanks so much it works super FINE....

Any tips on how to make this work for strings (or any other data types)?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service