Revit 2025 API
ViewSet |
Sets if elements of the given category will be visible in this view.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public void SetCategoryHidden( ElementId categoryId, bool hide )
Public Sub SetCategoryHidden ( categoryId As ElementId, hide As Boolean )
public: void SetCategoryHidden( ElementId^ categoryId, bool hide )
member SetCategoryHidden : categoryId : ElementId * hide : bool -> unit
Parameters

Exception | Condition |
---|---|
ArgumentException | categoryId does not correspond to a Category. -or- Category cannot be hidden. |
ArgumentNullException | A non-optional argument was null |

This affects only if the category is set visible or invisible individually. Other Revit mechanisms
may also affect the visibility of elements of this category, including:
- The category classes settings for model categories, annotation categories, import categories or analytical model categories.
- View filters.
- Elements hidden individually in the view.
See Also