Stairs.GetStairsLandings Method

StairsGetStairsLandings Method

Returns all the stairs landing components in the stairs.

Namespace: Autodesk.Revit.DB.Architecture
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public ICollection<ElementId> GetStairsLandings()
Public Function GetStairsLandings As ICollection(Of ElementId)
public:
ICollection<ElementId^>^ GetStairsLandings()
member GetStairsLandings : unit -> ICollection<ElementId> 

Return Value

ICollectionElementId
The stairs landing components in the stairs.
Example
private void GetStairLandings(Stairs stairs)
{
    ICollection<ElementId> landingIds = stairs.GetStairsLandings();
    string info = "Number of landings:  " + landingIds.Count;

    int landingIndex = 0;
    foreach (ElementId landingId in landingIds)
    {
        landingIndex++;
        StairsLanding landing = stairs.Document.GetElement(landingId) as StairsLanding;
        if (null != landing)
        {
            info += "\nThickness of Landing " + landingIndex + ":  " + landing.Thickness;
        }
    }

    TaskDialog.Show("Revit", info);
}
Private Sub GetStairLandings(stairs As Stairs)
    Dim landingIds As ICollection(Of ElementId) = stairs.GetStairsLandings()
    Dim info As String = "Number of landings:  " & landingIds.Count

    Dim landingIndex As Integer = 0
    For Each landingId As ElementId In landingIds
        landingIndex += 1
        Dim landing As StairsLanding = TryCast(stairs.Document.GetElement(landingId), StairsLanding)
        If landing IsNot Nothing Then
            info += (vbLf & "Thickness of Landing " & landingIndex & ":  ") + landing.Thickness
        End If
    Next

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

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also