Building Areas to surface in Dynamo

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.

Search on “trim” in the Dictionary:

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?

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.

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.

Did you try Archilab nodes?
There are also a couple of options to be found through the search field:

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?

Why don’t you use the connected boundaries output on the Collector.Areas node?

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.

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:

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.

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

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

Details on the custom node tstngwtrs-GroupCurves can be found here …


Surface.ByPatchPolyCurves from Chynamo works perfectly for this task

1 Like

Yep it does work like a charm.

Could you mark the post as solved then?

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

1 Like

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

Done :slight_smile:
(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”)

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

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.

1 Like