Sublists with same values

I have a list of many groups with “True” and “False”, and I want to get sublists for each “True” group and their index in the original list. How can I do it without programming?


Sift Pattern does this:
Canvas at 16;06;53

thanks for the tips, but my wish is to get 2 sublists from atteched example, one from index 0 to 5, one from 9 to 16. And the result is randomly from last step, that means there counld be more than 3 sublists.

Like this?

Not really like this! with your example there will be 7 sublist if False is choosen.

for direct sun hours, I need count the segments of the sun hours and each length of the segment

And so

or so

How do you make the labels above the components that show where they are located in the menus?


1 Like

Thanks @eddi

Looks like a useful plug-in, but unfortunately does not seem to work on Mac.

I see that it’s not listed as Mac compatible, but many plug-ins listed as Windows only work with the more current versions of Rhino/Grasshopper for Mac.


Dear Kevin,
i think is compiled only for Win-System, developer uses *.dll calls, specific for Windows.

At least share a simple file

similar (13.3 KB)

@anon39580149 you get my point, but I still need to remove the branches with 0
this calculation is for this purpose Direct Sun Analysis with more restrict - ladybug-tools - Ladybug Tools | Forum
similar (16.3 KB)

@eddi thank you all the same, your example is good to study

Use dispatch

similar (16.7 KB)

@anon39580149, you save my day! I get what I want, but 2 more issues for later thinking

  1. how can I get the index of the items those I choosed for the calculation?
  2. how does the List item component work? I don’t get it, I get -1 if I just give the index in the List

    similar (28.5 KB)
  • The file in the previous post have method to retrieve index from the original list

  • The component can used to retrieve index directly or you need use it with Delete consecutive

the index I wanna get are those take part of the last result. I extend the input to a larger list, that you can understand better. atteched file for example, I wanna get the index of those 35 items
similar (26.9 KB)

this one better, the result is from 2 segments.
in the process, some segments may be remove out of the calculation. The index should also be cutted. I will use this to visualize the geometry(show/hide)

similar (33.5 KB)

I don’t understand what you want and the steps in your script,
you must explain better from the beginning

ok, maybe it’s a strange rule or code, there’s stength controlling rule in china for the residential community planning, the direct sun hours in special day, 12.21 or 1.21, basically 2 hours. But different cities have some more details about the calculation. First of all, the timestep, almost 1 min or 5 mins. then the amount of continued segments. with the ladybug component it is not easy to get the accurate result, i need to do some post processing with the sunpath component of ladybug. for the test point, i need visualation with sun vectors as lines according the rules. further, i want get the simalar visulation like the direct sun hours analysis component with colorful meshes. for the Construction application there are Official Certificed programs, my idea is to get satisfied proofing in rhino for the concept phase without risk for later proofing with the official programs. Those rules are inherited from old USSR, which for me is absolute nonsense.