Sets the elements to be hidden in the view.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)

Syntax

C#
public void HideElements(
	ICollection<ElementId> elementIdSet
)
Visual Basic
Public Sub HideElements ( _
	elementIdSet As ICollection(Of ElementId) _
)
Visual C++
public:
void HideElements(
	ICollection<ElementId^>^ elementIdSet
)

Parameters

elementIdSet
Type: System.Collections.Generic..::..ICollection<(Of <(<'ElementId>)>)>
A set of ElementIds to be hidden.

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.

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

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentNullExceptionThrown when argument is nullNothingnullptra null reference (Nothing in Visual Basic).
Autodesk.Revit.Exceptions..::..ArgumentExceptionThrown 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.
Autodesk.Revit.Exceptions..::..InvalidOperationExceptionThrown when document regeneration failed.

See Also