Export IfcRelSpaceBoundary / Room boundaries

Hello,
I am sorry if the topic is already discussed, but I have been searching for a solution for a week. We use ifc in thermal simulation softwares. I have created a simple room in Dynamo as well as 4 walls, a floor and a ceiling. Unfortunately, the exported ifc file does not contain the entity IfcRelSpaceBoundary, which is crucial for the thermal simulation. I checked the boundaries of the created room and I found that they are only the 4 created walls without the floor or the ceiling. I tried to add the floor and ceiling to the room using Element.SetParameterByName, but I also failed. I am not sure if this is even the problem. Thanks in advance for the help.

Best Regards
Karim

Enable volumetric room calculations.

Hello Jacob,
Thanks for the reply, but volumetric room calculations are already allowed.

Hmmm… might be a transaction thing then. Can you provide a sample graph to reproduce with?

1 Like

here please :slight_smile: simple room Dynamo .unfortunately as a new user I can not upload files.

1 Like

After investing several hours, I noticed that the created rooms in Dynamo do not have top or bottom surfaces. When I connect the rooms to the node Rooms.Faces, it returns an error that rooms are not closed. What do you think? and do you suggest another method to create rooms in Dynamo (even using API)?

Not offhand… I haven’t been able to research this much as I was a bit tied up with the day job and some less complex issues. I’ve got a working sample now though, just have to compare to the non-automated methods first. Will try other API creation methods next.

I am noticing that the room geometry is correct, can you work with that for now?

1 Like

it’s ok :slight_smile: . Great that you got a working sample. I can not work with manual method as the main idea was to create a dynamo script that generates around 1000 different models that will go to simulation directly and the results will be embedded in a database. The script was fine generating geometry but the problem was exporting 2nd level space boundaries as I mentioned. Kindly have a look on the attached screenshots.



So I put some Python together to quickly test if a room had spatial bounding elements at it’s top and bottom. That code is as follows:

import clr #import the common language runtime to the Python environment so we can access .net tools
clr.AddReference("RevitNodes") #add the Revit nodes library to the common languge runtime
import Revit #import the Revit namespace
clr.ImportExtensions(Revit.Elements) #import the RevitElements extention 
clr.AddReference("RevitServices") #add th eRevit services library to the common language runtime
import RevitServices #import the revit services namespace
from RevitServices.Persistence import DocumentManager #import the doucment manager 
clr.AddReference("RevitAPI") #add the Revit API to the common language runtime
import Autodesk #import the autodesk namespace so we can load the Revit api
from Autodesk.Revit.DB import * #import all of the Revit API... this could be reduced

doc = DocumentManager.Instance.CurrentDBDocument #get the current document
rooms= UnwrapElement(IN[0]) #unwrap the Dynamo rooms to get to the tasty revit elments within
boundryElementLists = [] #an empty list for the final set fo boundary elements

calculator = SpatialElementGeometryCalculator(doc) #ge tthe spatial elemetn calculator for the document

for rm in rooms: #for each room
	boundingElements = [] #an empty list to hold it's bounding elements
	calc = calculator.CalculateSpatialElementGeometry(rm) #Get the calculation from results for the room using the spatial element calculator
	for face in calc.GetGeometry().Faces: #for each face in the calculated spatial boundaries
		bndFaces = calc.GetBoundaryFaceInfo(face) #get the boundary face from the face - basically convert the potentially merged faces into individual components
		elems = [doc.GetElement(f.SpatialBoundaryElement.HostElementId) for f in bndFaces] #get the element(s) associated to the boundary face
		[ boundingElements.append(i) for i in elems ] #append the bounding element to the bounding elements list
	boundryElementLists.append(boundingElements) #append the bounding elements list to the boundry element lists list... Say that 10 time fast

OUT = boundryElementLists #return the boundary element lists to the Dynamo environment

This returns both floors in my test graph (note that I’m using feet - you may want to address numbers accordingly to prevent overlapping objects).

The previously failing attempt may have had to do with the node which was used before, but I can’t troubleshoot it directly.

1 Like

THANKS Jacob!! The rooms now have identified top and bottom surfaces. But sadly when I export from revit an ifc it does not contain IfcRelSpaceBoundary. Could it be a bug related to Revit 2023? could you please try ifc Export?

Are you manually exporting the IFC, or via automation?

Sadly I don’t work with IFCs - in fact mostly I avoid them due to the lack of consistency in authoring tools and geometry storage and json is faster from a compute standpoint. Even if I did have one I wouldn’t know how to verify.

So that leads us to the next question… If you generate just the walls and floors using the graph set up like the image above (omitting the room placement), and then manually place a room and export an IFC, do you get a IfcRelSpaceBoundary element in the resulting file?

1 Like

I manually create the room in revit and then export the ifc manually, but I never get IfcRelSpaceBoundary in my exported file :confused:

So that category is generated in another way… This is a guess, but try creating a space instead of a room and see if that generates the required object.

Could also be relative to how your exporter is configured… Double check the settings and ensure you have the latest exporter.

Hello Jacob, after losing hope I found the problem :slight_smile:: I should have adjusted the phase of Energy settings to be the same as the phase of walls and spaces. Help: Energy Settings (autodesk.com)

Thanks so much for your support!

1 Like

The take away: make sure everything works if you do it manually before starting on the automation. :slight_smile:

1 Like