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.
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.DBPlanViewRange

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class PlanViewRange : IDisposable

The PlanViewRange type exposes the following members.

Properties
 NameDescription
Public propertyStatic memberCurrent View range for the current plane
Public propertyIsValidObject Specifies whether the .NET object represents a valid Revit entity.
Public propertyStatic memberLevelAbove View range for the level above the specified plane
Public propertyStatic memberLevelBelow View range for the level below the specified plane
Public propertyStatic memberUnlimited View range is unlimited
Top
Methods
 NameDescription
Public methodDisposeReleases all resources used by the PlanViewRange
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetLevelId Get the element id of the level for a View Depth plane
Public methodGetOffset Get the offset value associated with a View Depth plane
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodSetLevelId Set the level for a View Depth plane
Public methodSetOffset Set the offset value associated with a View Depth plane
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Example
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 != ElementId.InvalidElementId)
        {
            Element levelAbove = doc.GetElement(topClipPlane);
            TaskDialog.Show(view.Name, "Top Clip Plane: " + levelAbove.Name + "\r\nTop Offset: " + dOffset + " ft");
        }
    }

    return topClipPlane;
}
See Also