RVTDocs.com

Stairs

Class
Description:
Represents a stairs element in Autodesk Revit.
Remarks:
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.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.Element
    Autodesk.Revit.DB.Architecture.Stairs
Syntax
public class Stairs : Element
Examples
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;
}