Hello,
I have a few bookmarks are I am cycling through to export to PDF. I am using ArcGIS Pro 2.6's ArcGIS Notebooks. I am able to define the correct bookmarks and export to PDF, but when I try to make a custom name using the Dynamic Text that is present in the layout, I run into issues.
I have multiple a test site that has multiple sites within it. Let's say I have Test Site 1 and within Test Site 1 I have Sample Site A, Sample Site B, and Sample Site C. I have 2 bookmarks, 1 with Sample Site A & B visible, and the other with just Sample Site C visible.
This text is updated in my layout based on what sites are in the viewing extent of the map tab using the Attribute Dynamic Text option. So when I pan in the map, the text with change.
The problem is, I cannot get my python module to recognize this text as actual text.
I want to use the Test Site Name (Test Site 1) and whichever Sample Sites are visible in the map to build the name of my output file; essentially just concatenating the 2 strings and using it for the file name.
The "Location Name" is the name of the Map Element for Test Site 1. "Visible Test Sites" is the Map Element name for the Sample Sites.
Here is my code:
for bkmk in bkmks:
mf.zoomToBookmark(bkmk)
lns = lyt.listElements("TEXT_ELEMENT", "Location Name")
tst = lyt.listElements("TEXT_ELEMENT", "Visible Test Sites")
fname = lns + tst
lyt.exportToPDF(os.path.join(r"U:\Drones\Operations\BeneficialUseSites_Processing", str(fname)+".pdf"))
However, in the error it looks like it is using the Dynamic Text expression instead of the text itself in the file name. See attached screenshot.
Any ideas?