AnsweredAssumed Answered

Dynamic Layout Title (ArcGIS Pro)

Question asked by bisoftware on Dec 18, 2017
Latest reply on Dec 22, 2017 by Dan_Patterson

Is there a way to make the title of a layout dynamic with a feature class? I know there is dynamic text with the Map Frame, Project Name, Metadata, and many other things. From the research I have done it seems like it might have been possible in ArcMap, but I have been unable to find anything in ArcGIS Pro that would allow for the layout title to be dynamic with a feature class. 

 

To expand a little further. I have a large arcpy script where 80 layouts are created (from 1 template layout) and exported into a PDF, but right now each layout has the same generic title so sometime it is hard to know what data is being shown in the layout. This problem could be solved if the layout's title was Dynamic with the feature class that is being portrayed in the layout.

 

I considered using the following code, which uses the TextElement, but it looks to me like I would have to specify each individual title for every layout. And if I have 80+ layouts, that could take a long time. 

 

p = arcpy.mp.ArcGISProject("Current")
for lyt in p.listLayouts():   
    for elm in lyt.listElements("TEXT_ELEMENT"):       
        if elm.name == "title": # this is the element name set via text properties                 
           
# add layout feature class check logic           
            elm
.text = "New Title" # changing title name

Am I reading this right?

Is there a better way?

Outcomes