Random Selection by percentage/fraction?


Hi everyone!
I have a series of inputs with 5 parts (i.e. the pentagon in the image with its 5
plain pentagon.3dm (173.0 KB)
, although not all are pentagons) and I’m curious if there’s a way to use Grasshopper to randomly select 60%, or 3/5 of the parts within each input. Some of the inputs also have parts in quantities divisible by 5 (so 10, or 15), so I’m hoping there’s a way that I could use random selection by percentage or fraction rather than specifying a specific integer of parts to select – that way I can apply the script to multiple inputs at once, regardless if it has 5, 10, or 15 parts in it.

Hi,

Would this work?

KR,

RandomPertentageSelection.gh (14.6 KB)

2 Likes

just had time to open up this site the other day and yes this is perfect :slight_smile: thank you!!