Revit.Filter.OverrideGraphicSettings

How can we create a Revit.Filter.OverrideGraphicSettings through Python?

while in API, we just need an OverrideGraphicSettings object (which will be an Autodesk.Revit.DB.OverrideGraphicSettings object) but the View.SetFilterOverrides node requires a Revit.Filter.OverrideGraphicSettings.
And vice versa, the node OverrideGraphicSettings.ByProperties in Dynamo just create a Revit.Filter.OverrideGraphicSettings which will not be accepted for Category Override in view.
Thank you!

Hi Genius loci have a node for set view override and expect Autodesk dB override and written in python

I have checked the Genius loci package. There’s no View.SetFilterOverride node. And we just can get Filter override from existing setting in revit (that will be Revit.Filter.OverrideGraphicSettings) with Loci’s Get Filter Overrides node, not a new one from python.

allright think about add filter…but not sure 100 what you are after, or try as here

import clr
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

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

view = UnwrapElement(IN[0])
param_filter = UnwrapElement(IN[1])
override = IN[2]
hide = IN[3]

TransactionManager.Instance.EnsureInTransaction(doc)
try:
    if param_filter.Id not in view.GetFilters():
        view.AddFilter(param_filter.Id)
    view.SetFilterVisibility(param_filter.Id, not hide)
    if override:
        view.SetFilterOverrides(param_filter.Id, override)
finally:
    TransactionManager.Instance.TransactionTaskDone()

OUT = view

I got it! Thank you!
My error is because I’m using the dynamo node “View.SetFilterOverrides”, not the python script.

yes there are difference :wink: happy it could work :wink: