RailingType Class


An object supporting management of baluster and post placement within the railing type.

Namespace: Autodesk.Revit.DB.Architecture
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.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

CopyC#
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);
    }
}
CopyVB.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

SystemObject
  Autodesk.Revit.DBElement
    Autodesk.Revit.DBElementType
      Autodesk.Revit.DB.ArchitectureRailingType

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 →