algorithmic modeling for Rhino
I have a list of numbers:
1.524764
1.524764
1.524764
4.574291
4.574291
4.574291
7.623819
7.623819
7.623819
10.673346
10.673346
10.673346
13.722874
13.722874
16.772401
16.772401
19.821929
22.871456
25.920984
28.970511
I would like to group them by in branches so that the same numbers are in a branch together like this:
{0}
1.524764
1.524764
1.524764
{1}
4.574291
4.574291
4.574291
{2}
7.623819
7.623819
7.623819
{3}
10.673346
10.673346
10.673346
{4}
13.722874
13.722874
{5}
16.772401
16.772401
{6}
19.821929
{7}
22.871456
{8}
25.920984
{9}
28.970511
I have a parallel list of breps that I would like to group in the same way. Anybody have an idea of how to do this?
Tags:
Indeed even more simple. Thank you, Thomas.
I never use sets, so I'm sure this is will be even more helpful in the future.
Thank you!
Pieter, thanks for the response. The list I posted is from a simple (imaginary) master planning massing model. The numbers are the height of each floor volume. I sorted the list of heights in sync with the volumes. By grouping them, I am putting all the volumes for each floor in a separate branch where branch {0} are the ground floor volumes, {1} first floor, etc.
So for my purposes it is always increasing values. However, the next step for me would be to group by numbers that are close, but not necessarily the same, within a range. That is, the first floor of building A might have a slightly taller ground floor than building B, but I'd still want to report ground, 1st, 2nd, etc. floors of A and B together.
This simple version is a very specific, quick-and-dirty tool I needed today. I can see it being built-out a lot more, though, and your VB script definitely gives me ideas. Thanks.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by