Generating floor plan

Hello everyone,

I try to learn Dynamo to use in my thesis, I’m trying to create a floor plan that represents a villa, that changes with parameters in order to find the optimum building area. I used Autodesk SpacePlanning file, and developed it, as seen below.

The problem I’m facing now, that all the spaces are aligned horizontally and not overlapping or rotating to create corridors between spaces.

Can you help me?