SetCategoryHidden is not working as desired in Revit 2018

SetCategoryHidden is not working as desired in Revit 2018

Anonymous
Not applicable
742 Views
2 Replies
Message 1 of 3

SetCategoryHidden is not working as desired in Revit 2018

Anonymous
Not applicable

We had a Revit API which is used to Set the Visibility Toggled based on our requirements. It was working fine until Revit 2017.

With Revit 2018, the SetCategoryHidden is not working.

 

The error says Category cannot be hidden. 

 

Snippet

Category category = document.Settings.Categories.get_Item(BuiltInCategory.OST_Grids);

document.ActiveView.SetCategoryHidden(category.Id, true);

 

0 Likes
743 Views
2 Replies
Replies (2)
Message 2 of 3

Revitalizer
Advisor
Advisor

Hi,

 

the view you use may not be the one you expect:

https://forums.autodesk.com/t5/revit-api-forum/uidocument-activegraphicalview-and-uidocument-activev...

 

Also, may it be that the Grid visibility cannot be set in that view because of dependencies (Template, Filter) ?

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 3 of 3

Anonymous
Not applicable

Yeah, understand. Thank you.

0 Likes