Chop List into Specified Number of Sublists

Perhaps someone can help me out… I’m trying to chop a list into sublists based on a count. This example is looking at number of model lines drawn and then create that number of sublists. I would like to only have 3 sublists.

Any thoughts?

I’m not quite sure what you’re after… Can you show more of your graph and maybe show us an example of what you have and what you want? How did you decide that the third sublist got the extra item?

Sure thing… I’ve posted a larger image of that section. I’m working on a version of a generative plan design that uses model lines as the location of the corridors. This current example is showing having 3 corridor lines drawn (Major Corridor) and 7 programming bubbles. I was attempting to “evenly” split the list of programming bubbles across the number of corridor lines . I do not necessarily care where the extra item goes, but want to always have the number of corridor lines equal the number of sublists.

I’ve drawn this out the long way so you can see what’s happening step by step. It’s just a matter of determining how long each sublist needs to be. You can either add all the “extras” to the last sublist (top option) or you can evenly distribute them throughout the rest of the sublists (bottom option).

1 Like

you da man. That worked like a charm. Thanks.