# Select inner curve

**URL:** <https://forum.dynamobim.com/t/select-inner-curve/105968>\
**Category:** Developers\
**Tags:** revit, geometry, dynamo\
**Created:** [November 19, 2024, 7:56pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968 "2024-11-19T19:56:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zvith](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zvith](https://forum.dynamobim.com/u/zvith)\
**Post date:** [November 19, 2024, 7:56pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/1 "2024-11-19T19:56:20Z")

</div>

Hey all,  
I’ve been working on getting the inner perimeter of enclosed walls and my final method was to get the surfaces on the bottom of the wall geometry. Finally I got sets of curves that that make up both the inner and outer perimeter.

Anyone know of the better way to separate the inner curve from the outer curve?

Atm I am getting the location of the wall elements that give me the center line of the wall, from which I create a surface and intersect with the curves, managing to catch the inner curve that intersects with the sufrace.

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

I later try to move on to getting the curve for the full segment of wall, but as you can see in the attached picture, there is a point added to the connected part between the walls and I can’t manage to get the full length of the chord. I have tried creating a surface and then get the corners or edges, tried creating polycurve, nurbcurve and and still am stuck with the point along the line where the surface of the two walls meet. Part of the issue is that the curves aren’t organized of subsequent curves so when I create polygon it has lines crossing all over.  
Any suggestion of how to overcome this and get the points of the corners or the start and end of lines without having point mid curve?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 19, 2024, 8:01pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/2 "2024-11-19T20:01:34Z")

</div>

Do you have Rooms or Spaces in your model? You could get the boundary curves directly from either of them.

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [November 19, 2024, 9:56pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/3 "2024-11-19T21:56:59Z")

</div>

> [@Nick\_Boyts](#):
>
> Do you have Rooms or Spaces in your model? You could get the boundary curves directly from either of them.

And if not, you could use Dynamo to temporarily create them, place them, collect those boundaries and then delete the rooms while retaining the lines 🤩

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [November 19, 2024, 10:30pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/4 "2024-11-19T22:30:34Z")

</div>

You can do this with Python, but it is one of the ethics which wasn’t added to the library ages ago. I’ll see if I can find an example but am traveling so internet may be hard to come by. Just incase I don’t, the process is:

1. Bring the standard Dynamo geometry library into Python.
2. Bring the geometry from IN[0] in as ‘geo’
3. Pull the faces of the geometry with something like geo.faces
4. For each face:
  1. pull the coedges
  2. Remove any coedges which don’t have a true ‘IsExternal’ property.
  3. Pull the ‘edge’ from each coedge.
  4. Pull the curve geometry from the edge, and append it to the list of inner curves.

You can similarly divide the inner and outter curve set by pulling the edge and curve geometry and then appending to the ‘internal’ or ‘external’ loop based on the value of the ‘isexternal’ property.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [November 19, 2024, 10:57pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/5 "2024-11-19T22:57:46Z")

</div>

Missed a step - you have to querry the loops from each face, and those have the ‘IsExternal’ property.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/2/8238f13aee6648ca0e0e14ebabd8af98eaf5277e.png)

> **The Python code**
>
> ```Python
> ########################################
> ############## Properties ##############
> ########################################
> __author__ = 'Jacob Small'
> __version__ = '0.1.0'
> __description__ = """ """
> __DynamoBuilds__ = "3.1, but expected to work as far back as 2.8."
> __ReleaseNotes__ = "Only tested in Dynamo 3.1 - test other builds closely before deploying to production."
> __Dependancies__ = "None"
> __Copyright__ = "2024, Autodesk Inc."
> __license__ = """Apache 2.0"""
> 
> ########################################
> ### Configure the Python environment ###
> ########################################
> ### standard imports ###
> import sys #add the sys class to the Python environment so we can work with the sys objects
> import clr #add the CLR (common language runtime) class to the Python environment so we can work with .net libraries
> ### basic Dynamo imports ###
> clr.AddReference('ProtoGeometry') #add the Dynamo geometry library to the CLR
> from Autodesk.DesignScript import Geometry as DG #add the Dynamo geometry class using the alias DG, to ensure no overlap between class calls in Revit or Dynamo
> 
> #########################################
> ###### Global variables and inputs ######
> #########################################
> geo = IN[0] #surface class object from the IN[0] port of the Dynamo environment
> external, internal = [],[] #defining empty lists for the external and internal curve loops
> 
> #########################################
> ############# Get all loops #############
> #########################################
> faces = geo.Faces #get the faces from the geometry object
> for face in faces: #for each face
> loops = face.Loops #get the loops
> for loop in loops: #for each loop
> crvs = DG.PolyCurve.ByJoinedCurves([coEdge.Edge.CurveGeometry for coEdge in loop.CoEdges]) #build a polycurve form the set of each coedge's edge as curve geometry
> if loop.IsExternal: external.append(crvs) #if the loop is external append it to the exetrnal set - for a regular surface there should only be one of these
> else: internal.append(crvs) #otherwise append it to the internal set
> 
> #########################################
> ##### Return the results to Dynamo ######
> #########################################
> OUT = {"external": external, "internal": internal} #sends polycurves back to the Dynamo environment in a dictionary
> 
> ```

---

<div class="post-metadata">

**Author:** ![Jamie.Hein\_WHE](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@Jamie.Hein\_WHE](https://forum.dynamobim.com/u/Jamie.Hein_WHE)\
**Post date:** [November 20, 2024, 6:27am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/6 "2024-11-20T06:27:37Z")

</div>

You could create 2 polycurves by using polycurve.byjoinedcurves then turn each polycurve into a surface. Find the area of each surface and the smaller will be the inside curves. Which you can extract the curves from said inner polycurve. Hope that makes sense, written on phone at 1:21am lol

Just thought of another option. There is a node to get reference of the walls and not location. If all walls have the exterior to the outside you can find all the interior horizontal references, turn these into curves and voila. This might be from a custom package. Will edit this post with more info in the morning.

---

<div class="post-metadata">

**Author:** ![zvith](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zvith](https://forum.dynamobim.com/u/zvith)\
**Post date:** [November 20, 2024, 7:30am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/7 "2024-11-20T07:30:42Z")

</div>

I haven’t been working with rooms and spaces and would have to get more familiar with these functions. This is a clean model where I have only selected walls and got certain walls that weren’t drawn in a particular order.

---

<div class="post-metadata">

**Author:** ![zvith](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zvith](https://forum.dynamobim.com/u/zvith)\
**Post date:** [November 20, 2024, 7:32am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/8 "2024-11-20T07:32:55Z")

</div>

Thanks for the response.  
I will try to figure this out. Would the action be to select the walls and assign it a room and that will give the inner and outer wall boundary?

---

<div class="post-metadata">

**Author:** ![zvith](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zvith](https://forum.dynamobim.com/u/zvith)\
**Post date:** [November 20, 2024, 7:49am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/9 "2024-11-20T07:49:10Z")

</div>

Hi Jacob, thanks for the response.  
Can you explain what exactly face.Loops does or where I can check it up?  
Does it know how to detect inner/outer boundaries?

---

<div class="post-metadata">

**Author:** ![zvith](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zvith](https://forum.dynamobim.com/u/zvith)\
**Post date:** [November 20, 2024, 8:30am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/10 "2024-11-20T08:30:47Z")

</div>

I tried the script you suggested, just that I did it using code blocks. As you can see in the img attached, all loops are defined as “IsExternal”.  
Was this part supposed to filter out the inner and outer curves?

I will just emphasis that the walls selected were pulled from a project in which they haven’t been drawn in a chain, rather in random order and direction. I am guessing that that has an impact.

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

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [November 20, 2024, 9:51am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/11 "2024-11-20T09:51:34Z")

</div>

I would take your ‘bottom’ faces, merge them into one surface, and then try the Python above. Design script likely will have issues.

---

<div class="post-metadata">

**Author:** ![zvith](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zvith](https://forum.dynamobim.com/u/zvith)\
**Post date:** [November 20, 2024, 11:14am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/12 "2024-11-20T11:14:45Z")

</div>

So uniting the merging the surface to one surface did the job! (polysurface did not).  
Quite elegant. Thanks!  
(Worked with Design script)

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

Quite Amazing, it also returns the points at the cornors of the walls!

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

---

<div class="post-metadata">

**Author:** ![zvith](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zvith](https://forum.dynamobim.com/u/zvith)\
**Post date:** [November 20, 2024, 11:22am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/13 "2024-11-20T11:22:21Z")

</div>

> [@Jamie.Hein\_WHE](#):
>
> ope that makes sense, wri

That is the task at hand, to manage to group the inner curves and the outer curves.  
Creating a polycurve dosn’t work.

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

---

<div class="post-metadata">

**Author:** ![zvith](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zvith](https://forum.dynamobim.com/u/zvith)\
**Post date:** [November 20, 2024, 11:30am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/14 "2024-11-20T11:30:08Z")

</div>

Does this loop command and IsExternal work only when the surface is a closed shaped?

---

<div class="post-metadata">

**Author:** ![Jamie.Hein\_WHE](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@Jamie.Hein\_WHE](https://forum.dynamobim.com/u/Jamie.Hein_WHE)\
**Post date:** [November 20, 2024, 1:01pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/15 "2024-11-20T13:01:08Z")

</div>

![Sample](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/9/f909f4e384757bd1f4ba005605d1785c44a97b58.jpeg)

Here is a sample that I just threw together. Should be self explanatory. Let me know if it helps.

Genius Loci and Spring Nodes were used in this example. Also need to miter the corners.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [November 20, 2024, 3:44pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/16 "2024-11-20T15:44:50Z")

</div>

> [@zvith](#):
>
> when the surface is a closed shaped?

All surfaces are closed by one exterior loop (polysurfaces and non-manifold geometry excluded).

---

<div class="post-metadata">

**Author:** ![glenncai](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@glenncai](https://forum.dynamobim.com/u/glenncai)\
**Post date:** [January 29, 2025, 4:56am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/17 "2025-01-29T04:56:03Z")

</div>

Hi All,  
Found this can be done by using the Surface.InnerPerimeterCurves node too.  
but not sure what module is needed to get access to AnalyticalAutomation functions in the script, any ideas?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 29, 2025, 8:46am UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/18 "2025-01-29T08:46:35Z")

</div>

> [@glenncai](#):
>
> not sure what module is needed to get access to AnalyticalAutomation functions

Not sure which node(s) you are referring to here. Can you screenshot something?

---

<div class="post-metadata">

**Author:** ![glenncai](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@glenncai](https://forum.dynamobim.com/u/glenncai)\
**Post date:** [January 29, 2025, 10:04pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/19 "2025-01-29T22:04:37Z")

</div>

Hi Jacob, here is the screen shot of the node:  
AnalyticalAutomation.Surface.InnerPerimeterCurves(surface)

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

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 29, 2025, 10:10pm UTC](https://forum.dynamobim.com/t/select-inner-curve/105968/20 "2025-01-29T22:10:15Z")

</div>

Assuming that Revit menu in your library is for primary OOTB tool, then it was likely released in a newer build of Dynamo for Revit.
