I’ve built up a QC tool that will enable elements (rooms in this case) to have a colour override assigned based on a defined parameter value
I have set the view to EnableTemporaryViewPropertiesMode() and assign HideElementTemporary to elements that do not meet the defined parameter value.
To assign a colour value to the rooms I’m using doc.ActiveView.SetElementOverrides(room_id, settings)
which commits itself to the view despite being in TemporaryViewPropertiesMode. I was under the impression that there was a way to set the ElementOverride temporarily, but maybe I’m missing something?
from pyrevit import revit, DB, forms
try:
selection = revit.get_selection()
if len(selection)>0:
with revit.Transaction('Clear graphical overrides'):
# erase overrides
src_style = DB.OverrideGraphicSettings().Dispose()
# get clear graphics without overrides
src_style = DB.OverrideGraphicSettings()
for element in selection:
revit.active_view.SetElementOverrides(element.Id, src_style)
else:
forms.alert('You must select at least one element.', exitscript=True)
except:
pass