Skip to content

View.HideElements

Public Class

Sets the elements to be hidden in the view.

Namespace: Autodesk.Revit.DB

Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public void HideElements(
ICollection<ElementId> elementIdSet
)

Parameters

elementIdSetICollection. ElementId.

A set of ElementIds to be hidden.

Exceptions

Exception

Condition


ArgumentNullException

Thrown when argument is ..


ArgumentException

Thrown when the set of elements to be hidden is empty or one of the elements can not be hidden. Also thrown when the set of elements to be hidden includes the view itself.


InvalidOperationException

Thrown when document regeneration failed.


Remarks

This change is permanent until the elements are unhidden. All elements in the set must be currently unhidden and must be allowed to be hidden. An application can check this with IsHidden(View) and CanBeHidden(View).

Some elements cannot be hidden directly. Examples include: group, array, constraint, edit cut profile, face splitter and link to external documents.

Also, elements cannot be hidden in Revit family documents (but they can be hidden temporarily using [M:Autodesk.Revit.DB.View.HideElementsTemporary(System.Collections.Generic.ICollection`1{Autodesk.Revit.DB.ElementId})]).

To hide a group completely, you must also include all members of all groups and nested groups in your input.