Rectangle pattern

Hello everyone,

I am currently working on my thesis on a modular facade and would like to solve the following problem:

I have defined a number of rectangular-shaped blocks, in this case, I have five (2x3, 2x2, 4x1, 3x1, 1x1)
Now I would like grasshopper to automatically create a random pattern that would fill out the large rectangle (In this case 4m X 20).
I’ve followed the solution made by @laurent_delrieu (Rectangle false "packing" (Sample and example) - Grasshopper), but I don’t have a 1x1 grid, but a 3x3, as you can see in the picture and the facade is on the xz plane, not on the xy. After changing the grid dimensions and the plane the script doesn’t work anymore. Is there a way to make these changes?
I would be very thankful if someone can give me a hand here!

Cattura

Hello
the script is intended to work on XY plane. So stay on it and do the transformations at the end (translation, rotation, …)
What is

?

Thank you so much, the transformations on the xz plane worked!
As you can see from the picture, the grid that I need to use is the original grid multiplied by 3, every square of my grid is composed of 3x3 squares of the base grid. The original grid is {1,1,0}, mine needs to be {3,3,0}, but when I change the script it doesn’t work. I was wondering if there’s a way to change that or to scale everything at the end

Scale seems to be right answer.
I used 1x1, one is not a dimension (lenghth), it is an unit (sort of pixel here).

Thank you so much! It worked perfectly!