Stairs Class

Represents a stairs element in Autodesk Revit.

Namespace: Autodesk.Revit.DB.Architecture
Assembly: RevitAPI (in RevitAPI.dll) Version: (
Since: 2013


public class Stairs : Element
Visual Basic
Public Class Stairs _
	Inherits Element
Visual C++
public ref class Stairs : public Element


This element may represent a standalone Stairs element, or a member of a MultistoryStairs element. Use MultistoryStairsId to identify if this Stairs element is a part of a MultistoryStairs.


Copy C#
private Stairs GetStairInfo(Document document)
    Stairs stairs = null;

    FilteredElementCollector collector = new FilteredElementCollector(document);
    ICollection<ElementId> stairsIds = collector.WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_Stairs).ToElementIds();
    foreach (ElementId stairId in stairsIds)
        if (Stairs.IsByComponent(document, stairId) == true)
            stairs = document.GetElement(stairId) as Stairs;

            // Format the information
            String info = "\nNumber of stories:  " + stairs.NumberOfStories;
            info += "\nHeight of stairs:  " + stairs.Height;
            info += "\nNumber of treads:  " + stairs.ActualTreadsNumber;
            info += "\nTread depth:  " + stairs.ActualTreadDepth;

            // Show the information to the user.
            TaskDialog.Show("Revit", info);

    return stairs;
Private Function GetStairInfo(document As Document) As Stairs
    Dim stairs__1 As Stairs = Nothing

    Dim collector As New FilteredElementCollector(document)
    Dim stairsIds As ICollection(Of ElementId) = collector.WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_Stairs).ToElementIds()
    For Each stairId As ElementId In stairsIds
        If Stairs.IsByComponent(document, stairId) = True Then
            stairs__1 = TryCast(document.GetElement(stairId), Stairs)

            ' Format the information
            Dim info As [String] = vbLf & "Number of stories:  " + stairs__1.NumberOfStories
            info += vbLf & "Height of stairs:  " + stairs__1.Height
            info += vbLf & "Number of treads:  " + stairs__1.ActualTreadsNumber
            info += vbLf & "Tread depth:  " + stairs__1.ActualTreadDepth

            ' Show the information to the user.
            TaskDialog.Show("Revit", info)
        End If

    Return stairs__1
End Function

Inheritance Hierarchy

System Object
Autodesk.Revit.DB Element
Autodesk.Revit.DB.Architecture Stairs

See Also