Turn curves into a close rectangle

Hi

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?


2
3

maybe this helps

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

Hi

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

Hi,

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

798ba5442a91215a3ff0687273003434ef893132

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
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

data=IN[0]
result=[]

for d in data:
	p1=str(d.GetType())
	result.append(p1)

OUT = result
2 Likes

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