RailingType Class


A railing type object that is used in the generation of railing.

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 RailingType : ElementType
Visual Basic
Public Class RailingType _
	Inherits ElementType
Visual C++
public ref class RailingType : public ElementType

Examples

Copy C#
private void GetRailingType(Stairs stairs)
{
    ICollection<ElementId> railingIds = stairs.GetAssociatedRailings();
    foreach (ElementId railingId in railingIds)
    {
        Railing railing = stairs.Document.GetElement(railingId) as Railing;
        RailingType railingType = stairs.Document.GetElement(railing.GetTypeId()) as RailingType;

        // Format railing type info for display
        string info = "Railing Type:  " + railingType.Name;
        info += "\nPrimary Handrail Height:  " + railingType.PrimaryHandrailHeight;
        info += "\nTop Rail Height:  " + railingType.TopRailHeight;

        TaskDialog.Show("Revit", info);
    }
}
Copy VB.NET
Private Sub GetRailingType(stairs As Stairs)
    Dim railingIds As ICollection(Of ElementId) = stairs.GetAssociatedRailings()
    For Each railingId As ElementId In railingIds
        Dim railing As Railing = TryCast(stairs.Document.GetElement(railingId), Railing)
        Dim railingType As RailingType = TryCast(stairs.Document.GetElement(railing.GetTypeId()), RailingType)

        ' Format railing type info for display
        Dim info As String = "Railing Type:  " + railingType.Name
        info += vbLf & "Primary Handrail Height:  " + railingType.PrimaryHandrailHeight
        info += vbLf & "Top Rail Height:  " + railingType.TopRailHeight

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

Inheritance Hierarchy

See Also