# Element.Geometry operation failed on Rooms - PolyCurves may be branching

**URL:** <https://forum.dynamobim.com/t/element-geometry-operation-failed-on-rooms-polycurves-may-be-branching/72576>\
**Category:** Revit\
**Tags:** geometry, dynamo\
**Created:** [January 24, 2022, 1:36pm UTC](https://forum.dynamobim.com/t/element-geometry-operation-failed-on-rooms-polycurves-may-be-branching/72576 "2022-01-24T13:36:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PedersenJPP](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@PedersenJPP](https://forum.dynamobim.com/u/PedersenJPP)\
**Post date:** [January 24, 2022, 1:36pm UTC](https://forum.dynamobim.com/t/element-geometry-operation-failed-on-rooms-polycurves-may-be-branching/72576/1 "2022-01-24T13:36:47Z")

</div>

Hi Dynamo Users.

Im trying to create a script to get walls and rooms from a linked model and sort the walls with all of its sorrounding rooms.

In initial testing phase this worked fine, but when using it on an actual project I keep getting this error: PolyCurves may be Branching when trying to convert the Rooms to geometry to test intersection with walls.  
I might have gone to fast with testing on a project way too large, but i just dont understand why it cant draw all rooms.

Furthermore i’m loosing a lot of walls when using Element.Geometry on them. Some/most of them are curtain walls, any idea on how to fix this?

 ![AcousticWorkflowTest_2022-01-24_02-36-03](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/d/0de90b0e967cafa41c7de7964146215fa996471b.png)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [January 25, 2022, 9:12am UTC](https://forum.dynamobim.com/t/element-geometry-operation-failed-on-rooms-polycurves-may-be-branching/72576/2 "2022-01-25T09:12:17Z")

</div>

Hi,

So for the room geometry, unfortunately Revit will allow complexity of room geometry that Dynamo just can’t handle (as a solid). From memory, if you use the room.boundary node, that is very robust? Perhaps you could creatively use that instead?

That polycurve error is, in my experience, related to lines (obvs a wall is a kind of line based element) where you get a Y kind of shape or 2 lines on top of each other and Dynamo doesn’t know which way to resolve it?

For your own interest, I would probably filter out those fails, grab a couple and select them in Revit to have a look at… Maybe you will find a consistent issue that you could find a work around with?

Hope that helps,

Mark

---

<div class="post-metadata">

**Author:** ![PedersenJPP](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@PedersenJPP](https://forum.dynamobim.com/u/PedersenJPP)\
**Post date:** [January 26, 2022, 10:34am UTC](https://forum.dynamobim.com/t/element-geometry-operation-failed-on-rooms-polycurves-may-be-branching/72576/3 "2022-01-26T10:34:03Z")

</div>

Hello Mark.

Thank you for the reply.  
I will try with the room.boundary node to see if I happen to get better results.  
Is this a way to get around the need to create the geometry in Dynamo?

Very large models tend to have a long execution time, and if i could remove the part of creating geometry and just compare the already created geometry in revit i would get a faster runtime (Maybe RevitAPI has some information stored about rooms and its bounding walls? I just dont understand C# very well, only Python to some extend)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [January 26, 2022, 10:56am UTC](https://forum.dynamobim.com/t/element-geometry-operation-failed-on-rooms-polycurves-may-be-branching/72576/4 "2022-01-26T10:56:32Z")

</div>

Hey no worries!

I’m not 100% following your graph, but I think so… 🙂

```auto
for boundarylist in item.GetBoundarySegments(options):
	for boundary in boundarylist:
		blist.append(boundary.Element)

```

Yeah, avoiding geometry will speed things up, though I always like to have the option of viewing the results in Dynamo to check for funnies… Perhaps that can be a frozen side branch just used for de-bugging?

Hope that helps,

Mark
