ViewPlan.SetUnderlayRange Method

ViewPlanSetUnderlayRange Method

Sets the underlay base and underlay top to the specified levels.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public void SetUnderlayRange(
	ElementId baseLevelId,
	ElementId topLevelId
)
Public Sub SetUnderlayRange ( 
	baseLevelId As ElementId,
	topLevelId As ElementId
)
public:
void SetUnderlayRange(
	ElementId^ baseLevelId, 
	ElementId^ topLevelId
)
member SetUnderlayRange : 
        baseLevelId : ElementId * 
        topLevelId : ElementId -> unit 

Parameters

baseLevelId  ElementId
The element id of a level in the project or InvalidElementId. If InvalidElementId, then the underlay base level is not set and no elements will be displayed as underlay.
topLevelId  ElementId
The element id of a level in the project or InvalidElementId. If InvalidElementId, then the underlay range is unbounded.
Exceptions
ExceptionCondition
ArgumentException The ElementId baseLevelId does not correspond to a Level in the project. -or- The ElementId topLevelId does not correspond to a Level in the project. -or- The elevation of level topLevelId must be greater than the elevation of level baseLevelId.
ArgumentNullException A non-optional argument was null
Example
private void ViewUnderlay(ViewPlan planView, ElementId topLevelId, ElementId baseLevelId)
{
    if (planView.GetUnderlayOrientation() == UnderlayOrientation.LookingDown)
    {
        if (planView.GetUnderlayTopLevel() != topLevelId)
        {
            planView.SetUnderlayRange(baseLevelId, topLevelId);
        }

        planView.SetUnderlayOrientation(UnderlayOrientation.LookingUp);
    }
}
Private Sub ViewUnderlay(planView As ViewPlan, topLevelId As ElementId, baseLevelId As ElementId)
    If planView.GetUnderlayOrientation() = UnderlayOrientation.LookingDown Then
        If planView.GetUnderlayTopLevel() <> topLevelId Then
            planView.SetUnderlayRange(baseLevelId, topLevelId)
        End If

        planView.SetUnderlayOrientation(UnderlayOrientation.LookingUp)
    End If
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