Snapping Curves on a Horizontal Plane

Hello!!
I have been trying to snap a branch of curves with another branch of curves on a horizontal plane.


I have tried to use curve collide component from Kangaroo 2, But some how not achieved the results.
The Idea is to achieve something like this.

I have used the magnetizing floor plans plugin to the initial apartment configurations. Sharing the grasshopper file below.

Apartment Towers.gh (59.0 KB)