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?
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.
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