Array Rectangle Within a Boundary

Hello all,

I am fairly new to grasshopper so bear with me :sweat_smile:

My goal is to create a series of area studies on a site. I have the site boundaries, a max buildable area, a maximum number of floors and a typical city block. I would like to be able to change the number of floors to see how many blocks are be needed on the site to meet the max area.

So far I have been able to figure out how to array the rectangle to meet the maximum area but I can’t seem to figure out how to create that array within the site boundaries AND still maintain the maximum number of blocks.

I have also been able to figure out how to array the blocks within the site boundaries, and somehow I can get it to meet the max building area (more or less) but the solution I found doesn’t allot me to change the number of floors.

Any ideas?

Thank You!

Site Boundary.3dm (60.2 KB) Test_1.gh (47.2 KB)