# Building Areas to surface in Dynamo

**URL:** <https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755>\
**Category:** Geometry\
**Created:** [October 19, 2017, 6:57am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755 "2017-10-19T06:57:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 19, 2017, 6:57am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/1 "2017-10-19T06:57:50Z")

</div>

Hi,  
I am trying to create surfaces from my areas created in area plans in my model. I need it to later figure out room locations and fill up department information etc.  
Now I can create surfaces fairly easily when my area doesnt have cut outs or loops inside. But when My area has any cut out or loop I can’t seem to get a polyline or surface that is in a loop. Have spent quite a few hours trying to it out but no luck.  
ANy hints would be great.

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

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 19, 2017, 7:18am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/2 "2017-10-19T07:18:44Z")

</div>

Search on “trim” in the Dictionary:  
[http://dictionary.dynamobim.com/#/Geometry/Surface/Action/TrimWithEdgeLoops](http://dictionary.dynamobim.com/#/Geometry/Surface/Action/TrimWithEdgeLoops)

---

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 19, 2017, 7:35am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/3 "2017-10-19T07:35:15Z")

</div>

Hi Yna,  
Thanks for the advice.  
The issue is I can’t work out a way to find/generate the loops. It just gives me all the lines of the Area Boundary as a list. How do I generate separate polycurves for each loop? Every way failed.  
Triming is quite possible only when I can have the distinct loops for each area right?

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 19, 2017, 7:41am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/4 "2017-10-19T07:41:31Z")

</div>

You will possibly find different solutions for that but one of them would be to use the OOTB _PolyCurve.ByJoinedCurves_ node and/or _Group Curves_ from Archilab.

---

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 19, 2017, 8:10am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/5 "2017-10-19T08:10:52Z")

</div>

Oh I have tried all sort of grouping and making point loops… simplifying them… literally everything.  
PolyCurve.ByJoinedCurves was literally the first thing I tried.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/0/20e4359111ea6c4529946233e2f48e4b50932cf8.png)

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 19, 2017, 8:12am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/6 "2017-10-19T08:12:11Z")

</div>

Did you try Archilab nodes?  
There are also a couple of options to be found through the search field:  
[https://forum.dynamobim.com/search?q=Group%20Curves](https://forum.dynamobim.com/search?q=Group%20Curves)

---

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 19, 2017, 8:22am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/7 "2017-10-19T08:22:51Z")

</div>

Oh yes I did try that too.  
Th only partial success I found was from Ampersands polycurvebycurve but it still fails in multiple cases.  
I am already trying to think of some other way. Maybe generate geometry from the Color Scheme edges. Couldn’t find anything on that too though. Any clue?

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

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 19, 2017, 8:24am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/8 "2017-10-19T08:24:39Z")

</div>

Why don’t you use the connected boundaries output on the _Collector.Areas_ node?

---

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 19, 2017, 8:28am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/9 "2017-10-19T08:28:01Z")

</div>

Oh that gives null straight away. The way the collector node makes the connected boundaries is pretty inefficient anyways. Thats the primary reason why I am using the Pyhton script rather than using the connected boundaries.

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

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 19, 2017, 8:33am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/10 "2017-10-19T08:33:34Z")

</div>

> [@Amrit\_Banerjee](#):
>
> The way the collector node makes the connected boundaries is pretty inefficient

This needs some more details to be understood.  
At this stage, I get polygons out of it.  
_Room.Boundaries_ from Clockwork works also with the areasElements output.  
Then PolyCurve.ByJoinedCurves creates the needed polycurves.  
You could maybe need the help of a containment test but I don’t have time to check, see here:  
[http://dictionary.dynamobim.com/#/Geometry/Polygon/Action/ContainmentTest](http://dictionary.dynamobim.com/#/Geometry/Polygon/Action/ContainmentTest)

---

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 19, 2017, 9:01am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/11 "2017-10-19T09:01:14Z")

</div>

The screen shot in my earlier post is actually a screen shot of how the collector node works. It is just using the Polycurv.byjoinedcurves to make a polygon. It doesn’t really consider cutouts or loops.  
the room.boundaries does give the boundaries but the issue is the boundaries for areas dont really need to be joined always. It has a threshold in revit built in so it doesn’t always create a loop… so using the room.boundaries doesnt cut it for me sadly.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 19, 2017, 9:40am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/12 "2017-10-19T09:40:28Z")

</div>

Try _Surface.ByPatchPolyCurves_ (Chynamo). Optionally, double-clic on it to see how it’s build…

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [October 22, 2017, 3:20am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/13 "2017-10-22T03:20:00Z")

</div>

@Amrit_Banerjee Here is an example with an area with cut outs

 ![20171021-1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/9/39e7af66c166bd1f4ad03fb12cbcfa3b69bbec21.png)

Details on the custom node _tstngwtrs-GroupCurves_ can be found here …

> [@Grouping Curves with Design Script](https://forum.dynamobim.com/t/grouping-of-curves-with-design-script/15122):
>
> Design script definition that groups a list of shuffled curves into loops… On the package manager search for tstngwtrs-GroupCurves However the node doesn’t need to be downloaded, paste the below code in a code block and call grpCrvs(crv) def grpCrvs(crv:var[]..[]) { dis1 = (crv.StartPoint)\<1\>.DistanceTo(crv\<2\>)==0 ||(crv.EndPoint)\<1\>.DistanceTo(crv\<2\>)==0; ind1 = List.AllIndicesOf(dis1\<1\>,true); bln1 = true; ind2 = [Imperative] { …

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 22, 2017, 7:22am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/14 "2017-10-22T07:22:06Z")

</div>

_Surface.ByPatchPolyCurves_ from Chynamo works perfectly for this task

 ![Chynamo-Surface-ByPatchPolyCurves](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/4/04f2c0340c0ddaa395219d752b7622fe90365f22.PNG)

---

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 24, 2017, 9:28am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/15 "2017-10-24T09:28:19Z")

</div>

Yep it does work like a charm.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 24, 2017, 9:29am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/16 "2017-10-24T09:29:52Z")

</div>

Could you mark the post as solved then?

---

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 24, 2017, 9:30am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/17 "2017-10-24T09:30:00Z")

</div>

Hi Vikram, That is probably the fastest solution. But could you explain me what actually the tstngwtrs-GroupCurves does?

---

<div class="post-metadata">

**Author:** ![Amrit\_Banerjee](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Amrit\_Banerjee](https://forum.dynamobim.com/u/Amrit_Banerjee)\
**Post date:** [October 24, 2017, 9:32am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/18 "2017-10-24T09:32:04Z")

</div>

Sure I will. Lemme figure out how to mark as solved first though 🙂

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 24, 2017, 9:33am UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/19 "2017-10-24T09:33:51Z")

</div>

Done 🙂  
(click on the three points that can be seen at the back of each post, you will find a button with this tooltip: “This reply solves the problem”)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [October 26, 2017, 12:09pm UTC](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755/20 "2017-10-26T12:09:20Z")

</div>

> [@Amrit\_Banerjee](#):
>
> That is probably the fastest solution

Probably because it doesn’t use any geometry intersection (which can be really heavy) to do it’s job.

> [@Amrit\_Banerjee](#):
>
> But could you explain me what actually the tstngwtrs-GroupCurves does?

If you have a list of shuffled curves, it groups together curves that form loops (open or closed)  
The illustration at the link I’ve provided above should give you a fair idea of what it does.

[Next page](https://forum.dynamobim.com/t/building-areas-to-surface-in-dynamo/15755.md?page=2)
