Turn curves into a close rectangle


I’m trying to turn a curve that are chosen from Revit that is already are a rectangle but not connected. Because I need the center point of the rectangle so that the wall that I chose will offset to the midpoint of the rectangle.

As seen in the pictures the node boudingbox centerpoint was used to make the rectangle close so the midpoint would be found.

And as seen in Revit, all the walls don’t offset into the middle and the midpoint are divided into 4 points and not 1.

But I guess that is not the node to be used. Is there another node that can make these lines to a close rectangle?


maybe this helps

Also, the direction in which a wall has been drawn makes a big defference


I dont want to intersect the lines. I want to make them into a close rectangle and find the center point.


Could you please draw what is your expected output ? I may have a script that can help, but it needs adaptation.

try boundingbox nodes, that will give you the centrepoint


Hi, this is what I expect

Is this what you want ?
Note1 : this works with non orthogonal/random walls too.
Note2 : you’ll have to change the script a little to make it run with lists and sublists, or to have more complex rooms computed, but the intersectionPoint function remains the same.

Results from your example :

Graph :

File :

Intersections.dyn (15.1 KB)

1 Like

Or something like this?

Python code below:

import clr
from Autodesk.DesignScript.Geometry import *

from Autodesk.Revit.DB import *

import Revit


for d in data:

OUT = result

Thank you so much for all the answers. They were very helpful.

@deen86 Assuming the walls are always aligned to the X and Y axes, you could also try this…

recCen.dyn (18.4 KB)

1 Like