Random Select From List

Hi Hi!
I have been putting together a lil script that randomly places scaled figures on a surface with a random orientation. that part works, but I am struggling to find a way to only have one of the scale figures be placed. My intention is to be able to randomly select one scaled figure from the list and place it on one of the random points.

thanks in advance.

Populator.gh (12.4 KB)

This is one possibility. I used a quick python script to generate the random numbers, but you could easily use the Random component again if you dont have Python.

Populator_Rev2.gh (14.9 KB)

tanks man! I’ve been using the random component, but that didn’t solve for the placing only one object to a point.

The python script doesn’t really help with getting one object (not directly anyway), it is just generating a random number, same as the Random component but you dont have to alter the seed value every time. The trick it to flatten the list from your first Orient component output so you can then use list item to get only one object.

1 Like

Here is a way withour Scripting. But it is better if you internalise some data.


I flipped/transpose data after rotation, remove all data except one. In order to not have the same seed I generated n(here 14) seeds. That’s all.
PopulatorLD.gh (21.7 KB)

1 Like

Ah interesting! I never knew about the flipped data command. Thank you for the guidance.