PlanViewRange Class

This class represents the view range of a plan view or a plan region. It records the element ids of the levels which a plane is relative to and the offset of each plane from that level.

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


public class PlanViewRange : IDisposable
Visual Basic
Public Class PlanViewRange _
	Implements IDisposable
Visual C++
public ref class PlanViewRange : IDisposable


Copy C#
private ElementId GetViewRangeTopClipPlane(Document doc, View view)
    ElementId topClipPlane = ElementId.InvalidElementId;

    if (view is ViewPlan)
        ViewPlan viewPlan = view as ViewPlan;
        PlanViewRange viewRange = viewPlan.GetViewRange();

        topClipPlane = viewRange.GetLevelId(PlanViewPlane.TopClipPlane);
        double dOffset = viewRange.GetOffset(PlanViewPlane.TopClipPlane);

        if (topClipPlane.IntegerValue > 0)
            Element levelAbove = doc.GetElement(topClipPlane);
            TaskDialog.Show(view.Name, "Top Clip Plane: " + levelAbove.Name + "\r\nTop Offset: " + dOffset + " ft");

    return topClipPlane;
Private Function GetViewRangeTopClipPlane(doc As Document, view As View) As ElementId
    Dim topClipPlane As ElementId = ElementId.InvalidElementId

    If TypeOf view Is ViewPlan Then
        Dim viewPlan As ViewPlan = TryCast(view, ViewPlan)
        Dim viewRange As PlanViewRange = viewPlan.GetViewRange()

        topClipPlane = viewRange.GetLevelId(PlanViewPlane.TopClipPlane)
        Dim dOffset As Double = viewRange.GetOffset(PlanViewPlane.TopClipPlane)

        If topClipPlane.IntegerValue > 0 Then
            Dim levelAbove As Element = doc.GetElement(topClipPlane)
            TaskDialog.Show(view.Name, "Top Clip Plane: " + levelAbove.Name + vbCr & vbLf & "Top Offset: " + dOffset + " ft")
        End If
    End If

    Return topClipPlane
End Function

Inheritance Hierarchy

System Object
Autodesk.Revit.DB PlanViewRange

See Also