I am trying to find a script that exports my layout in ArcPro to a JPG once a week. Most of what I have found when searching has been for map series. Can anyone assist? Thanks!
Hi Linda
would this works for you?
import arcpy docPath = r"D:\FOLDER" docName = r"AGSPRODOC.aprx" p = arcpy.mp.ArcGISProject(docPath+"\\"+docName) # ge a list of all layouts in your map dox lLayout = p.listLayouts() for l in lLayout: print(l.name) #You could add an if statement to print ONLY a specific layout l.exportToJPEG(docPath+"\\"+l.name+"jpg") print("Process Completed")
Thanks! That worked!!! Much appreciated!
hummm I am not sure. it's working for me (see image below). Can you try to add a new dynamic txt for the count just for fun.
@DominicRobergeIADOT , this works great! Thank you! However, one thing it is not doing is including my dynamic text that I have in the layout. I have a date/time exported and a record count. Any idea how to get the print command to include those?
This help page seems to imply you can just export a single layout to just about whatever image format you like. The arcpy.mp module does takes a little getting used to.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.