Disable "show annotation categories in this view" check box

I am working on a script manipulating viewports and view titles. The annotation such as grids and levels make calculating certain center locations difficult and produces undesired results. To combat this I can uncheck the “show annotation categories in this view” and then run the dynamo scrips and everything works. I would like to build that step into the my graph but I can not find a way to uncheck that setting.

This is just a property of the view.

@dmillerSNYXQ just replace the property mentioned by @Nick_Boyts in the following script:

Thank you, @Nick_Boyts and @Elie.Trad, for the help. I am not sure how to select both of you for providing the solution; it seems I can only choose one post as the solution.

I think this is a read-only thing but not able to set yes/no “Show annotation categories in the view” ?

It’s a get/set parameter so it should work. Pretty sure I’ve used it in the past.

1 Like

Is there a view template assigned to the view that you are trying to modify? This could control whether or not you can check/uncheck for the particular view. (You should be able to check in the Visibility Graphics Dialog)

1 Like

Hi, I tried but I just saw relevant remark from Mr. Joe.Charpentier
reponse 04 01 2024

I leave script just in case

import sys
import clr

clr.AddReference("RevitAPI")
import Autodesk 
from Autodesk.Revit.DB import View

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager 

doc = DocumentManager.Instance.CurrentDBDocument
view_source=UnwrapElement(IN[0])
bool=IN[1]

TransactionManager.Instance.EnsureInTransaction(doc)
if bool:
    view_source.AreAnnotationCategoriesHidden=bool
    message='Annotation Category is hide'
else:
    view_source.AreAnnotationCategoriesHidden=bool
    message='Annotation Category is active'
TransactionManager.Instance.TransactionTaskDone()

OUT = message

sincerely
christian.stan

3 Likes