Hi everyone
I have some python code, apparently running ok, to get the horizontal area of two stair runs getting their line boundaries through Revit API. The code seems to be working, but I am getting all lengths multiplied by more or less 3, more or less (default width is 1.00 m and I’m getting 3.28 m).
Does anybody know what could be going on? Thank you all so much in advance
stairs = UnwrapElement(IN[0])
runIds = stairs.GetStairsRuns()
runs = [stairs.Document.GetElement(runId) for runId in runIds]
bounds = [run.GetFootprintBoundary() for run in runs]
len = []
for bound in bounds:
for line in bound:
len.append(line.ApproximateLength)
isplanar = [bound.HasPlane() for bound in bounds]
planes = [bound.GetPlane() for bound in bounds]
isopen = [bound.IsOpen() for bound in bounds]
isrect = []
areas = []
width = []
height = []
for plane in planes:
isrect.append(bounds[planes.index(plane)].IsRectangular(plane))
if isrect[planes.index(plane)] is True:
width.append(bounds[planes.index(plane)].GetRectangularWidth(plane))
height.append(bounds[planes.index(plane)].GetRectangularHeight(plane))
areas.append(bounds[planes.index(plane)].GetRectangularWidth(plane)*bounds[planes.index(plane)].GetRectangularHeight(plane))
else:
areas.append('error')
OUT = runs, bounds, len, isplanar, isopen, isrect, areas, width, height