GetStairsSupports Method


Returns all the stairs support components in the stairs.

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

Syntax

C#
public ICollection<ElementId> GetStairsSupports()
Visual Basic
Public Function GetStairsSupports As ICollection(Of ElementId)
Visual C++
public:
ICollection<ElementId^>^ GetStairsSupports()

Examples

Copy C#
private void GetStairSupports(Stairs stairs)
{
    ICollection<ElementId> supportIds = stairs.GetStairsSupports();
    string info = "Number of supports:  " + supportIds.Count;

    int supportIndex = 0;
    foreach (ElementId supportId in supportIds)
    {
        supportIndex++;
        Element support = stairs.Document.GetElement(supportId);
        if (null != support)
        {
            info += "\nName of support " + supportIndex + ":  " + support.Name;
        }
    }

    TaskDialog.Show("Revit", info);
}
Copy VB.NET
Private Sub GetStairSupports(stairs As Stairs)
    Dim supportIds As ICollection(Of ElementId) = stairs.GetStairsSupports()
    Dim info As String = "Number of supports:  " & supportIds.Count

    Dim supportIndex As Integer = 0
    For Each supportId As ElementId In supportIds
        supportIndex += 1
        Dim support As Element = stairs.Document.GetElement(supportId)
        If support IsNot Nothing Then
            info += (vbLf & "Name of support " & supportIndex & ":  ") + support.Name
        End If
    Next

    TaskDialog.Show("Revit", info)
End Sub

See Also