Stack objects of different sizes in a random area

If you look at the picture I added, you can see objects of different sizes piled up. Is there a function to randomize this or is there an example?
box2

box1

Hi @luckynumber4477 this other post isn’t exactly what you’re looking for but it might give you some ideas:

I don’t know how to run that one.

Isaac Sim?
vscode ?
Please tell me how.