Create direct shape from rooms_Springs.Revit.DirectShape

Hello guys,
We are trying to create direct shapes from rooms using the node Spring.BrepShape.ByGeometry,
This is the only one that I have found doesn’t crash Revit, however I have 356 rooms and we have a problem with a 4 items.

"Traceback (most recent call last):File “”,line 94, in NewDS_R17
Exception:BrepBuilder::addCoEdgeInternal_() cannot assign edge geometry for edge 85 do to inaccuracies between the coedge and its defining curve.
Parameter name: edgeId

Attached definitions, screenshots and revit model

I have tested on Dynamo 1.3.3 and 2.0.2 and Revit 2018, both same result

Create solids (Direct Shape) from rooms_v2.dyn (73.2 KB)

Many thanks!

Anyone can drop a bit of light here please?

Not sure what is wrong the the node/workflow?

Sounds like it’s not a Dynamo issue but a Revit one. We would need the RVT files which recreate the room geometry of the failing rooms to provide any help or insight.

Thanks Jacob,I thought I had attached the .rvt file before.

Too large,

See below link, many thanks

Hello Jacob,

Any luck with the file?

Nope - my work responsibilities have me tied up and triple booked away from my laptop until this weekend. I can try them but I’m the meantime perhaps others will step in.


Was there a reason you wanted a Brep? Direct Shape Works?


I would be really interested to know what that error means, unfortunately that’s beyond me…

For future reference, if you’re getting the element ids, you can go select that in Revit and have a play with what might be going wrong…

Hope that helps,



Revit has only three ways of creating smooth geometry:

  1. Through the basic methods - extrusions, revolves, lofts, etc. + boolean operations. You can add materials, but the problem with that is that you can only make simple solids and anything even slightly complicated would be a big challenge.
  2. Through imports (dwg / sat). The problem with that is that you can’t assign materials to the imported faces and the importer occasionally flunks out. This is what the DirectShape.ByGeometry node uses.
  3. Through the relatively new BRepBuilder. This gives you the most power but also comes with a lot of complexity, because you can create your geometry face by face and even set the material per face. However the API for it is extremely strict. That’s because the geometry has to be topologically correct and manifold, so that the geometry kernel can rationalize it (figure out how to display it, which part is in and which is out, what’s the area, volume and other BIM relevant stuff, etc.).

The BrepShape.ByGeometry node uses the third method and tries to make as many workarounds as possible to import something in revit that at least looks correct, but may not report correctly (area, volume, etc.).

Why does the node fail with some rooms? Well you have to remember that rooms don’t technically have any geometry. Instead their geometry is defined by the bounding elements around them and is re-computed every time you open your project. To make this process faster and more reliable, that calculation has to include certain workarounds that in some cases might create tiny inaccuracies that later get compounded and end up producing geometry that is not topologically robust. You can even sometimes observe that behavior in 2d if you try to extract the boundaries of the rooms that fail, you probably won’t be able to create a closed polycurve from them because of tiny gaps.


Thanks Dimitar,

I was hoping you would jump in :slight_smile:

So my logic runs… (please point out my error)… Revit does have a method for establishing the 3D boundaries for these rooms, however complex they are, in a way that it finds satisfactory, to extract areas and volumes. Is there anything we can do to get access to the same method?



Not that I know of but you can use something like the SpatialElementGeometryCalculator to get more detailed info on the bounding elements for analysis.

Another thing you could try experimenting with is the ExporterIFCUtils.GetRoomBoundaryAsCurveLoopArray method but I suspect that just uses the standard Room.GetBoundarySegments method to get the pre-calculated boundaries.

1 Like

Hello Mark,

Revit crahes when I use the node Springs.DirectShape.ByGeometry, not sure why!..

Thanks Dimitar for your help,

if there are tiny inaccuracies why the polycurve and solids are created in dynamo?

No crashes here (I had to turn off your visibility filter to see them)




Thanks Mark for testing!!!

I am going to give it a go

thanks again!!!

Not sure. Possibly Revit’s Rooms & Dynamo’s solids can have larger tolerances than the BrepBuilder

So quite surprisingly… the Room.FinishBoundary works if you use PolyCurve.ByPoints :slight_smile:

Incidently the other methods also work!

1 Like

You were totally right Mark,


Thank you very much,

By the way, nice testing Brep with Room.Finishboundary!!!

You nailed it

1 Like