Moving multiple geometries to terrain

Hi,
I am trying to move multiple geometries that are stacked on top of each other (i.e. ground floor, podium and tower elements), onto a terrain surface. I can move/project the elements onto the surface, but they did not keep their order and spacing (see image).

I have tried using a bounding box, but it doesn’t group them effectively.

Is there a way to group/join the geometries that are touching, so they read as one element to then project onto the surface?

I see GH green in the screenshot but question is for rhino? Is this Grasshopper question? If so correct post tags.
Maybe something like this should allow to move whole buildings. Is that what you want?
Otherwise you have to provide duplicate vectors for each slab with correct length above terrain.
Its hard to troubleshoot without file…

Hi Eddard,
Thank you for replying! This is a grasshopper question - apologies.
I have added a sample file to assist.

I think the script needs to calculate the distance from the bottom of the geometry to the top of the terrain surface?

Projecting Built Form to Terrain.3dm (1.1 MB)

FYI.

Move.gh (109.6 KB)

fantastic! thanks!