AnsweredAssumed Answered

Toggle Text Element Visibility in ArcGIS Pro

Question asked by KBerg_RambollEnv on Feb 25, 2020
Latest reply on Feb 25, 2020 by KBerg_RambollEnv

I'm trying to turn off visibility of a text element called "Draft" on 20 layouts in in an aprx. The script runs without errors, but the element doesn't get turned off on any of the pages.

 

import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\Users\kberg\Documents\DataGapEvaluation.aprx")
for lyt in aprx.listLayouts():
    for elm in lyt.listElements('TEXT_ELEMENT'):
        if elm.text == "Draft":
            elm.visible = False
aprx.save()
del aprx

Outcomes