Python Script Get Phases Graphic Overrides

Hi everyone,

I’m new in python scripts with Dynamo and I’m trying to get the current value of the Phases Graphic Override as string with the Revit API.

I’ve been looking through the Revit API with “Autodesk.Revit.DB.OverrideGraphicSettings”, “Autodesk.Revit.DB.PhaseFilter” and “Autodesk.Revit.DB.Phase” for a “method” but I’ve found nothing…

Any tips/clue about that topic ?
Thank you in advance

It looks like phase overrides are determined through a material which will have the properties you are looking for. So, if you collect all of the materials in the document, filter them to ones matching the specific names for phases, you can then get all of the material’s properties.

Something like this:

phase_names = ['Phase - Exist', 'Phase - Demo', 'Phase - New', 'Phase - Temporary']
materials = FilteredElementCollector(doc).OfClass(Material)
phase_mats = []
for mat in materials:
    if mat.Name in phase_names:
        phase_mats.append(mat)

Edit: This will not provide access to the Halftone property which is present for actual OverrideGraphicSettings. If the phase appearances are truly overridden then this will also not be reflected, but this strategy might get you closer to your goal.

Great! I tried your script and it works. I can get the colors of the Projection/surface but I can’t get the lines pattern and weight… Maybe there’s a link with the object styles and a X phase?

Also, thank you for your answer. I am close to my goal! :+1: