Setting view AreAnnotationCategoriesHidden property

As found on the Apidocs:

The following code does not return an error but doesn’t change the property as expected.


It has to be possible to change the property as shown in the apidocs: “set” but i havn’t figured out how.
Using C# it’s as easy as = true, but using dynamo and python this seems a bit harder…

credits: Serhan_BAKIR

If you have an idea on how to access the property and how to set it, please respond.

Kind regards,

Timo Walraven

Hi, im not sure where you have a mistake in the code, so try this one:

import clr
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
curview = uidoc.ActiveGraphicalView

curview.AreAnnotationCategoriesHidden = True
OUT = 0

It works perfectly! I thought I tried this one at first but apparently not. Stupid mistake…
Thank you!