A product with a random amount of sub-products

I’m creating a feeder that produces trays with subproducts (cylinders) on. i wan’t the cylinders on the tray to vary between 7-12 randomly, but I can’t seem to find out how to change the subproducts value

Hope you guys can help :slight_smile:

Probably easiest to do a different assembly for each subproduct amount.

Then you use a distribution mode for creating a random assembly.

3 Likes

I had a similar example which I changed for your case:

  • you can create an assembly with each cylinder in a different step (the Auto Assembly Addon works great for this!)
  • create the Assembly with only the step of the Tray
  • use a While-loop to import one cylinder a random amount of time (with the InterpolationTransport time set on 0)

Create Assembly with Random Amount of Products.vcmx (453.9 KB)

4 Likes

Thanks for the suggestions <3

Where do you control the ratio in which the feeder choses how many cyllinders that comes out

In the Process #1:

I created 2 variables in the process: a counter and an integer to store a random number. You can use the uniform function to generate a random number in a range –> Uniform distribution in range a <= x < b

In each iteration of the while loop, it will get one product (the GetAssembly allows you to choose the first empty step, that’s why you need all cylinder in a different step).

It will loop until the variable “counter” reach the random value generated by the uniform function.

1 Like