Grasshopper

algorithmic modeling for Rhino

Hi

I have a list which contains 150 items. Now I want to split this list into sublists of 6 items, so that I have 25 lists of 6 items (list1: item0-item5, list 2: item6-item11 ...). How can I achieve this?

Niels

Views: 3061

Replies to This Discussion

I managed to do it using series to define domains and then use this domains as an input to the sublist component. I have a new problem however, now I have 25 lists of 6 items and I want to shift every list (shift=1), so I have 25 lists of 5 items. When I use shift however it shifts the 25 lists instead of the 6 items in each list, so I have 24 lists of 6 items. How can I use the shift on the sublist instead of the list of lists?

You just need to set the boolean value of the shift list component on true, so it can wrap te list and mantein the same number of items

Hi Goossens,

Is this what you want to achieve:


btw, cool profile photo :)

Attachments:

Hey Goossens,

I also had a lot of trouble with Grasshoppers treatment of paths; its so confusing at first. It would be nice if GH included a set of components that allowed you to divide list of items in number of items per path or number of paths, or to divide paths in number of paths or number of items per path. 

So I took matters to my own, and I put together a definition which allows this. I usually just open that definition and copy the set of components I want to the definition I'm working with.

The virtue of this definition is that it works without using the Pathmapper component, which has the limitation that one must change the sintax manually. 

The definition is by no means mine, I just put it together from others already posted on this site, and changed and added some things.

Lastly, be wary that there may be some bugs on the definition, because I made it for my own use and never intended to make it public. 

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service