Thanks for your response, Mitch. When I run my original script in its entirety, I don't receive any errors, but nothing happens with regard to the mapseries script (I'm assuming because the "if not" statement didn't have an "else" statement following it).
Running your lines of code produces the same result -- the script still seems to hit a dead end and l.mapSeries still equates to "None" (generated in the Python window)
if not l.mapSeries is None:
ms = l.mapSeries
if ms.enabled:
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
else:
ms.enabled = True
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
print(l.mapSeries)
None
I also tried altering indentation so the "else" statement aligns with the "if not", which does generate the following traceback error (see below):
if not l.mapSeries is None:
ms = l.mapSeries
if ms.enabled:
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
else:
ms.enabled = True
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
Traceback (most recent call last):
File "<string>", line 6, in <module>
AttributeError: 'NoneType' object has no attribute 'enabled'
So is the hangup here that we need syntax not only to enable the mapseries, but also to inject any required properties? For example, the ArcGIS Pro tool dialogue insinuates that the map frame, layer, name field, sort field are all required.
Thoughts?