<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue Exporting Map Series as Jpegs Using Arcpy.mp Module in ArcGIS Pro 2.8 in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1067588#M41942</link>
    <description>&lt;P&gt;Hi Jeff, can confirm. I'm actually in the process of converting my python label expressions to Arcade syntax.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jun 2021 22:04:09 GMT</pubDate>
    <dc:creator>JesseClark</dc:creator>
    <dc:date>2021-06-11T22:04:09Z</dc:date>
    <item>
      <title>Issue Exporting Map Series as Jpegs Using Arcpy.mp Module in ArcGIS Pro 2.8</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1065672#M41728</link>
      <description>&lt;P&gt;Can anyone in the ArcGIS Pro community help me understand why this tool I created in a python toolbox for exporting a page series as Jpeg files hangs up on map 1 of 37, but does not produce an error message? Map 1 is exported as a 4 kb jpg file when viewed in Windows Explorer, but cannot be opened. Meanwhile the tool continues running, without exporting additional files. Any guidance is appreciated - thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;class exportPageSeriesAsJPG(object):
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label = "Export Page Series as JPGs"
        self.description = ""
        self.canRunInBackground = False

    def getParameterInfo(self):
        """Define parameter definitions"""

        param0 = arcpy.Parameter(name = "targetProject", \
                                 displayName = "Target Project", \
                                 datatype = "DEFile", \
                                 parameterType = "Required",\
                                 direction = "Input")
        
        param0.filter.list = ['aprx']
        
        param1 = arcpy.Parameter(name = "targetFolder", \
                                 displayName = "Target Folder", \
                                 datatype = "DEFolder", \
                                 parameterType = "Required",\
                                 direction = "Input")

        param2 = arcpy.Parameter(name = "targetLayout", \
                                 displayName = "Layout", \
                                 datatype = "GPString", \
                                 parameterType = "Required",\
                                 direction = "Input")
        
        param2.filter.type = "ValueList"
        param2.filter.list = []
        
        params = [param0,param1,param2]
        return params

    def isLicensed(self):
        """Set whether tool is licensed to execute."""
        return True

    def updateParameters(self, parameters):
        """Modify the values and properties of parameters before internal
        validation is performed.  This method is called whenever a parameter
        has been changed."""

        if parameters[0].value:
            project = arcpy.mp.ArcGISProject(parameters[0].value)
            parameters[2].filter.list = sorted([layout.name for layout in project.listLayouts()])
        return 

    def updateMessages(self, parameters):
        """Modify the messages created by internal validation for each tool
        parameter.  This method is called after internal validation."""
        return

    def execute(self, parameters, messages):
        """The source code of the tool."""
        import os
        filePath = os.path.abspath(parameters[1].ValueAsText)        
        project = arcpy.mp.ArcGISProject(parameters[0].value)
        layout = project.listLayouts(parameters[2].value)[0]
        if layout.mapSeries.enabled:
            for pageNum in range(1, layout.mapSeries.pageCount + 1):
                layout.mapSeries.currentPageNumber = pageNum
                arcpy.AddMessage("Exporting {0}".format(layout.mapSeries.pageRow.SITE_ID))
                layout.exportToJPEG(os.path.join(filePath, f"{layout.mapSeries.pageRow.SITE_ID}.jpg"),300)
                              
        return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 17:27:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1065672#M41728</guid>
      <dc:creator>JesseClark</dc:creator>
      <dc:date>2021-06-08T17:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Exporting Page Series as Jpegs Using Arcpy.mp Module in ArcGIS Pro 2.8</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1065754#M41733</link>
      <description>&lt;P&gt;Jesse, I just ran your exact code (plus I added the Toolbox class to make it complete) and it worked for me on Pro 2.8 and Pro 2.7.&amp;nbsp; Are there any other special Map Series settings?&amp;nbsp; For example, are you setting page numbers in any way to either have a starting number or using a page number field?&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp and Layout teams&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 20:22:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1065754#M41733</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-06-07T20:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Exporting Page Series as Jpegs Using Arcpy.mp Module in ArcGIS Pro 2.8</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1065773#M41736</link>
      <description>&lt;P&gt;Thanks for running the code on your end Jeff. The confirmation that it worked was useful. I'm including a clip of the map series options window used in the layout. Nothing stands out, except the sort field... maybe. I did just run the tool on a layout in a different ArcGIS Pro project file with success, so I'll circle back and have a closer look at my map series settings in the project having issues. I'll probably export as a PDF series using the regular export layout function in Pro and see if I can get it to cough up an error to work with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Map Series Options.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/15356i876A8F0052EBEB02/image-size/large?v=v2&amp;amp;px=999" role="button" title="Map Series Options.PNG" alt="Map Series Options.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 21:35:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1065773#M41736</guid>
      <dc:creator>JesseClark</dc:creator>
      <dc:date>2021-06-07T21:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Exporting Map Series as Jpegs Using Arcpy.mp Module in ArcGIS Pro 2.8</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1067573#M41938</link>
      <description>&lt;P&gt;Further inspection suggests the export issue has to do with at least one of several label classes created when I imported the layout from an existing ArcMap document. I discovered the map series exports fine with the python code when all label classes are disabled.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 21:11:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1067573#M41938</guid>
      <dc:creator>JesseClark</dc:creator>
      <dc:date>2021-06-11T21:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Exporting Map Series as Jpegs Using Arcpy.mp Module in ArcGIS Pro 2.8</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1067575#M41939</link>
      <description>&lt;P&gt;Hi Jesse,&lt;/P&gt;&lt;P&gt;We just had a support issue created where if a label class has a PYTHON expression then export via arcpy.mp to PDF causes the script to hang.&amp;nbsp; Turning of labels, as you discovered, help but so does does changing the expression engine from Python to Arcade. Can you please confirm?&amp;nbsp; This was a new bug for 2.8. If its the same thing, we prioritized it as a 2.8 patch candidate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 21:16:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1067575#M41939</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-06-11T21:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Exporting Map Series as Jpegs Using Arcpy.mp Module in ArcGIS Pro 2.8</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1067588#M41942</link>
      <description>&lt;P&gt;Hi Jeff, can confirm. I'm actually in the process of converting my python label expressions to Arcade syntax.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 22:04:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-exporting-map-series-as-jpegs-using-arcpy-mp/m-p/1067588#M41942</guid>
      <dc:creator>JesseClark</dc:creator>
      <dc:date>2021-06-11T22:04:09Z</dc:date>
    </item>
  </channel>
</rss>

