Dynamo scrips to combine multiple floors, including their subelement level

Hi. me and my collegues are trying to mess around with combining two or more floors into one larger floor, that will contain all the subcategory point elevations. does any of you have a script or some good pointers on how that might work?

Hello,
Welcome to our community. I suggest you to check out our forum guidelines to get answers quickly.
Is it possible for you to share what you have tried until now?

Hey!

i have tried two methods. one is a simple script that can “steal” the elevation points on the floor onto itself, so that it gets the same slope. that works great but it leaves the edges in the original level.

secondly i tried having a python script written that could aid me in combining floors: but im afraid that my dynamo knowledge isnt deep enough for this

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

Start a transaction

doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)

Get input floors

floors = UnwrapElement(IN[0])

Combine floor curves

combined_curves =
for floor in floors:
curve = floor.GetBoundarySegments(LoopOrientation.Forward)[0][0].GetCurve() # Get the boundary curve of the floor
combined_curves.append(curve)

Join the curves to create a combined curve

combined_curve = CurveArray()
for curve in combined_curves:
combined_curve.Append(curve)

Create a new floor with the combined curve

new_floor = doc.Create.NewFloor(combined_curve, False)

Commit the transaction

TransactionManager.Instance.TransactionTaskDone()

Output the new combined floor

OUT = new_floor

sorry the code looks weird with the Bold titles, its because the code uses #

Hello,

Here what I managed, the floor on the left is a single floor and just moved it to the left to make it more visible:

Since at the end we need to create a new floor, I started with Floor.ByOutlineTypeAndLevel node. I combined two floors into one using their sketches. Then updated the floor shape according to the floor points of previous floors. Collect.ElementSketch node is from Spring package.

I hope this is what you are looking for.

Hey, thank you very much

i made a solution to take the points from existing floors and then make a host floor to transfer them to.

could i ask you for your solution as a file ? just so i can take it apart and learn from it. if not then its also okay, and i appreciate your time and effort

Best regards Daniel & Co.

You need to select two floors for the select model elements node. I also added the Revit file.

amazing work you did.

with your exampel it works fine for 1-2 and if i the middle part it can accept more. but only the exact amount of steps youve added in the code block.

Is it possible to make it so its just which ever floor is picked that are touching will be joined?

thank you for your help, its greatly helping me understand the program and language further

i might have solved it myself.

heres my solution, id like to hear any thoughts on it :slight_smile:

1 Like

Looks great. :clap: