# Filled Region With Hole in the Middle - like a donut

**URL:** <https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838>\
**Category:** Revit\
**Tags:** revit, geometry, dynamo\
**Created:** [June 14, 2018, 9:53pm UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838 "2018-06-14T21:53:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbardales](https://avatars.discourse-cdn.com/v4/letter/g/7bcc69/32.png) [@gbardales](https://forum.dynamobim.com/u/gbardales)\
**Post date:** [June 14, 2018, 9:53pm UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/1 "2018-06-14T21:53:20Z")

</div>

Hello,  
I have been using Dynamo to create a filled Region with an empty space in the middle. I can create the filled Region just fine but when I add the extra linework to add the empty space in the middle, it gives an error. I been using FilledRegion.ByCurves node. Is there a way to create a filled Region with a hole in the middle, using Dynamo?  
See image below for filled Region. Thank you,

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/c/3c02e17daf9f9baaba2f3fdf2899fb17acbb0f34.png)

---

<div class="post-metadata">

**Author:** ![salvatoredragotta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salvatoredragotta/32/10078_2.png) [@salvatoredragotta](https://forum.dynamobim.com/u/salvatoredragotta)\
**Post date:** [June 14, 2018, 11:55pm UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/2 "2018-06-14T23:55:00Z")

</div>

I don’t think it’s possible…

a similar post for floors:

> [@Floor Sketches with Multiple Boundaries](https://forum.dynamobim.com/t/floor-sketches-with-multiple-boundaries/8070/8):
>
> One way to solve this, is to split your floor boundaries into two non-overlapping loops. In the case of a torus, that would be two C-shapes. Then create two floors from those loops and join them together. Visually it will look like one floor, however editing it manually later on would be more challenging, because you’d have to edit each half individually. I think I saw this approach first from Brian Ringley.

---

<div class="post-metadata">

**Author:** ![gbardales](https://avatars.discourse-cdn.com/v4/letter/g/7bcc69/32.png) [@gbardales](https://forum.dynamobim.com/u/gbardales)\
**Post date:** [June 15, 2018, 5:10pm UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/4 "2018-06-15T17:10:52Z")

</div>

Julian,  
Thank you for the script, it works very well. I can create any Filled Region in any view.  
I was woundering if I can do the same but with multiple Filled Regions in different views? I get an error when I tried to.

Thank you,

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/d/6d82e6cb7e566cce597b81ef044e22e6ecbe99f0.png)

---

<div class="post-metadata">

**Author:** ![salvatoredragotta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salvatoredragotta/32/10078_2.png) [@salvatoredragotta](https://forum.dynamobim.com/u/salvatoredragotta)\
**Post date:** [June 15, 2018, 11:42pm UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/5 "2018-06-15T23:42:28Z")

</div>

@jbo Nice! Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![bscott](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bscott](https://forum.dynamobim.com/u/bscott)\
**Post date:** [September 7, 2018, 2:56am UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/7 "2018-09-07T02:56:54Z")

</div>

Has anyone managed to get this python node to work for multiple filled regions in different views? I’ve been trying to work it out, but I don’t fully understand what’s happening in the for loop that groups the curves, or how to lace the filled region creation when there are multiple input lists.  
Thanks

---

<div class="post-metadata">

**Author:** ![gbardales](https://avatars.discourse-cdn.com/v4/letter/g/7bcc69/32.png) [@gbardales](https://forum.dynamobim.com/u/gbardales)\
**Post date:** [September 7, 2018, 5:27pm UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/8 "2018-09-07T17:27:53Z")

</div>

@bscott

I did not modify the script. I created a custom node as Julian mention it. Once you create a custom node you can lace it (see images below).

 ![01](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/2/02976620e829b7822b6d0cd5eb7e87236e5f68a2.jpeg)

 ![02](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/a/3a13757ba3dc7c311763161405590804dbe1a148.jpeg)

 ![03](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/e/5ed9719ae79e572cbe60dfa714871f71ebcb082d.jpeg)

---

<div class="post-metadata">

**Author:** ![Damiano](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@Damiano](https://forum.dynamobim.com/u/Damiano)\
**Post date:** [January 9, 2019, 7:36am UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/9 "2019-01-09T07:36:44Z")

</div>

Hi there, could you please share the script?  
I’m trying to create the custom node as you shown but it doesn’t work.  
Also in the custom node element id’s are set to accept string as input, but from the node in the full script element.id node return int

Many thanks

---

<div class="post-metadata">

**Author:** ![gbardales](https://avatars.discourse-cdn.com/v4/letter/g/7bcc69/32.png) [@gbardales](https://forum.dynamobim.com/u/gbardales)\
**Post date:** [January 11, 2019, 6:52pm UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/10 "2019-01-11T18:52:33Z")

</div>

Damiano,  
yeah, ignore the string input. It does require int.  
The script is below and in the link are the dyn file and the custom nodes I made.  
Hope this helps.

[https://dreyfussblackford-my.sharepoint.com/:f:/g/personal/gbardales\_db-arch\_com/Ei8RUIUJDShGszpUFap7ZFcBp\_pTrw4uvCPf4IIjSsbIaQ?e=dojMWr](https://dreyfussblackford-my.sharepoint.com/:f:/g/personal/gbardales_db-arch_com/Ei8RUIUJDShGszpUFap7ZFcBp_pTrw4uvCPf4IIjSsbIaQ?e=dojMWr)

```auto
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import System.Collections.Generic
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference('RevitServices')
from RevitServices.Transactions import TransactionManager
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

filledType = ElementId(IN[0])
viewId = ElementId(IN[1])
boundaries = IN[2]
boundariesLoop = List[CurveLoop]()

for i in boundaries:
	curves = List[Curve]()
	for x in i:
		curves.Add(x.ToRevitType())
		
	boundariesLoop.Add(CurveLoop.Create(curves))

TransactionManager.Instance.EnsureInTransaction(doc)
filled = FilledRegion.Create(doc, filledType, viewId, boundariesLoop)
TransactionManager.Instance.TransactionTaskDone()

OUT = filled

```

---

<div class="post-metadata">

**Author:** ![Damiano](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@Damiano](https://forum.dynamobim.com/u/Damiano)\
**Post date:** [January 14, 2019, 1:16pm UTC](https://forum.dynamobim.com/t/filled-region-with-hole-in-the-middle-like-a-donut/22838/11 "2019-01-14T13:16:40Z")

</div>

Many thanks for this, the script works nicely. Unfortunately it doesn’t process elements with sharing edges though, basically each slab/curve must be apart. Do you know if there’s a way around this?  
Otherwise we just going to use it for single slabs or multiple if they don’t share edges.  
Thank you
