# Find Corner points of a rectangular curve

**URL:** <https://forum.dynamobim.com/t/find-corner-points-of-a-rectangular-curve/106974>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [January 3, 2025, 2:17pm UTC](https://forum.dynamobim.com/t/find-corner-points-of-a-rectangular-curve/106974 "2025-01-03T14:17:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![safwat.elsaket](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@safwat.elsaket](https://forum.dynamobim.com/u/safwat.elsaket)\
**Post date:** [January 3, 2025, 2:17pm UTC](https://forum.dynamobim.com/t/find-corner-points-of-a-rectangular-curve/106974/1 "2025-01-03T14:17:53Z")

</div>

Hello Everyone  
I’m trying to create a script that would give the Length and Width as a string of rectangular Areas

I created the script and it’s working if the area boundary is not touching any other boundary  
Like this:

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

However in this situation the script reads the rectangle as having more than 4 points

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

I want to eliminate any point that is not a corner point in this node here:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/c/8c9e06e9e10dbecfc3d602e1b0a88c716cf3df40.png)  
[Area Boundary - RectangleWxL.dyn](https://forum.dynamobim.com/uploads/short-url/mVzb4hWo0pigxQo3LeHmqNUrgyg.dyn) (96.7 KB)

Attached is the dynamo file

Hope someone can help

Thank you all

---

<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:** [January 3, 2025, 2:30pm UTC](https://forum.dynamobim.com/t/find-corner-points-of-a-rectangular-curve/106974/2 "2025-01-03T14:30:20Z")

</div>

It would be good to start with _why_ the area is non-rectangular if it’s supposed to be. How are you getting the area boundary and what is it supposed to represent?

---

<div class="post-metadata">

**Author:** ![safwat.elsaket](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@safwat.elsaket](https://forum.dynamobim.com/u/safwat.elsaket)\
**Post date:** [January 3, 2025, 3:26pm UTC](https://forum.dynamobim.com/t/find-corner-points-of-a-rectangular-curve/106974/3 "2025-01-03T15:26:33Z")

</div>

Hi Nick  
the areas are either rectangular or triangular, the goal is to divide a large area and be able to represent it graphically using dimensions:

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

The script would save adding lengths and widths to those rectangle (and triangles) by including them into the tag.

The issue is that it works for Area 1 and Area 2 but not for Area 3 :

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/e/9e7f2551fc9bbd7b116e42f3e51878425e4a1060.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 4, 2025, 2:19am UTC](https://forum.dynamobim.com/t/find-corner-points-of-a-rectangular-curve/106974/4 "2025-01-04T02:19:04Z")

</div>

Pull the area boundaries, convert to polycurves, get the bounding box by minimum volume, transform the min and max point by the inverse or it’s coordinate system, build a vector between the two points, and pull the X (length) and Y (width) components.

---

<div class="post-metadata">

**Author:** ![safwat.elsaket](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@safwat.elsaket](https://forum.dynamobim.com/u/safwat.elsaket)\
**Post date:** [January 4, 2025, 11:45am UTC](https://forum.dynamobim.com/t/find-corner-points-of-a-rectangular-curve/106974/5 "2025-01-04T11:45:06Z")

</div>

Hey  
Thanks for this suggestion  
bounding box was the key, the coordinate system was a bit complicated for me and while trying to figure it out I stumbled upon the cuboid node which did the trick

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

With the bounding box width and length and with the area calculated by revit for the “area” elements  
I could filter rectangles and triangles  
Thanks again!
