When trying to create stairs (sketched run method) at a level other than Level 1 (0’- 0" elevation), they appear at an entire level higher than what it should be. Even though the floor to floor height and riser number is exactly the same, I get the error message:
“Stair bottom end exceeds or cannot reach the base elevation of the stair. Add/remove risers at the bottom end by control or change the stair run’s “Relative Base Height” parameter in the properties palette.”
Looking a the Relative Base Height in Revit for each run, they are exactly as expected, but the actual stairs are one level higher:
The stairs created first (shown here on Level 1) had no errors. Only when I adjusted the Levels (“Base” Level 2 and “Top” Level 3) does this behavior occur.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Architecture import StairsRun
from Autodesk.Revit.DB.Architecture import StairsLanding
from Autodesk.Revit.DB import CurveLoop
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
doc = DocumentManager.Instance.CurrentDBDocument
class StairsFailurePreprocessor( IFailuresPreprocessor ):
def PreprocessFailures(self, failuresAccessor):
return FailureProcessingResult.Continue
baseLevel = UnwrapElement(IN[0])
nextLevel = UnwrapElement(IN[1])
b1Curves = IN[2]
r1Curves = IN[3]
p1Curves = IN[4]
b2Curves = IN[5]
r2Curves = IN[6]
p2Curves = IN[7]
elCurves = IN[8]
TransactionManager.Instance.ForceCloseTransaction()
newStairsScope = StairsEditScope(doc, 'New Stairs')
newStairsId = newStairsScope.Start(baseLevel.Id, nextLevel.Id)
trans = Transaction(doc, 'Add Runs and Landings to Stairs')
trans.Start()
bdryCurves1 = list(b1Curves)
riserCurves1 = list(r1Curves)
pathCurves1 = list(p1Curves)
bdryCurves2 = list(b2Curves)
riserCurves2 = list(r2Curves)
pathCurves2 = list(p2Curves)
landingLoop = CurveLoop.Create(elCurves)
r1Count = len(r1Curves)
r2Count = len(r2Curves)
newRun1 = Autodesk.Revit.DB.Architecture.StairsRun.CreateSketchedRun(doc, newStairsId, baseLevel.Elevation, bdryCurves1, riserCurves1, pathCurves1)
newLanding = Autodesk.Revit.DB.Architecture.StairsLanding.CreateSketchedLanding(doc, newStairsId, landingLoop, newRun1.TopElevation)
newRun2 = Autodesk.Revit.DB.Architecture.StairsRun.CreateSketchedRun(doc, newStairsId, newLanding.BaseElevation, bdryCurves2, riserCurves2, pathCurves2)
trans.Commit()
newStairsScope.Commit(StairsFailurePreprocessor())
OUT = newStairsId
StairsAndLandingImport!!.dyn (111.1 KB)
I got some great help previously, so hopefully this won’t be much of a challenge.
Previous Topic
To be clear, the number of risers are correct. Just the level has changed. Also, this issue occurs with or without a previous successful run (at Level 1).
Any help is greatly appreciated.
Thanks,
LoRue