Hi, is there any method that I can get the width of stair from a sketch?
Because sketch stairs don’t necessarily have a consistent riser length (ie the left and right side diverge) you can’t pull a property directly - it’s intentionally blank in Revit for this reason. Pulling the footprint path or riser lines themselves and pulling the largest/smallest dimension (whichever you prefer).
is there any python script to check the stair is drawn by run or sketch?
The stair itself doesn’t have a property for this as you can have multiple runs in the stair, one sketched and one not. But the stair runs have this property, of which ‘sketched’ is a solution: StairsRunStyle Property
but I am new to revitapi and don’t know how to use this from revitapi docs
I got the following error:
You’re super close, and I know you can get there. A few hints:
- change line 16 to
runElement = doc.GetElement(run)as this will give you an element (rather than the ID) which you the element as a variable inside the for loop, so you can call it again as your code moves along the list.
- Change line 17 to
style = runElement.StIrRunStyle, changing the element we call the Property from to the newly declared variable, and removing the trailing () as this is a property, not a method.
- change line 18 to
runs.append(style)so you can output your newly found data back to Dynamo (consider renaming the runs variable too).