TemporaryViewModes Class

A data structure containing data related to temporary view modes.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: (17.0.1090.0)
Since: 2016 Subscription Update


public class TemporaryViewModes : APIObject
Visual Basic
Public Class TemporaryViewModes _
	Inherits APIObject
Visual C++
public ref class TemporaryViewModes : public APIObject


The class contains methods and properties to manipulate states of various temporary view modes that may or may not be avilable in any of visible views of a Revit document. The temporary modes are enumerated in the TemporaryViewMode class.

Every view that supports temporary view modes owns an instance of this TemporaryViewModes class, which can be obtained by accessing the TemporaryViewModes property of the View class. Note that views which do not support temporary modes will have that property's value be Null.


Copy C#
public bool RevealHiddenElementsInView(View view)
    bool hiddenRevealed = false;
    TemporaryViewModes viewModes = view.TemporaryViewModes;

    if (viewModes == null)
        TaskDialog.Show("Invalid View", "This view does not support temporary view modes.");
        // Mode must be available and enabled to be activated
        if (viewModes.IsModeEnabled(TemporaryViewMode.RevealHiddenElements) && viewModes.IsModeAvailable(TemporaryViewMode.RevealHiddenElements))
            viewModes.RevealHiddenElements = true;
            hiddenRevealed = viewModes.RevealHiddenElements;

    return hiddenRevealed;
Public Function RevealHiddenElementsInView(view As View) As Boolean
    Dim hiddenRevealed As Boolean = False
    Dim viewModes As TemporaryViewModes = view.TemporaryViewModes

    If viewModes Is Nothing Then
        TaskDialog.Show("Invalid View", "This view does not support temporary view modes.")
        ' Mode must be available and enabled to be activated
        If viewModes.IsModeEnabled(TemporaryViewMode.RevealHiddenElements) AndAlso viewModes.IsModeAvailable(TemporaryViewMode.RevealHiddenElements) Then
            viewModes.RevealHiddenElements = True
            hiddenRevealed = viewModes.RevealHiddenElements
        End If
    End If

    Return hiddenRevealed
End Function

Inheritance Hierarchy

System Object
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB TemporaryViewModes

See Also