Stairs Class


Represents a stairs element in Autodesk Revit.

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

Syntax

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

Examples

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;
}
Copy VB.NET
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
    Next

    Return stairs__1
End Function

Inheritance Hierarchy

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

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →