<?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: ExporttoPNG Python for MapSeries in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/1082318#M43677</link>
    <description>&lt;P&gt;I'm late to the party but this thread was helpful to me, so thanks Elizabeth for making the post. I modified your script ever so slightly and it ran just fine for me. Here is the snippit that I used:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os, sys&lt;BR /&gt;relpath = r'''F:\0 - Ranking All Unknowns\insetmaps'''&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;for item in aprx.listLayouts():&lt;BR /&gt;&amp;nbsp;itemname = item.name&lt;BR /&gt;&amp;nbsp;print(itemname)&lt;/P&gt;&lt;P&gt;l = aprx.listLayouts()[5]&lt;BR /&gt;print(l.name)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ms = l.mapSeries&lt;BR /&gt;for pageNum in range(1, ms.pageCount + 1):&lt;BR /&gt;&amp;nbsp;ms.currentPageNumber = pageNum&lt;BR /&gt;&amp;nbsp;pagename = ms.pageRow.Invnum&lt;BR /&gt;&amp;nbsp;print("{}".format(pagename))&lt;BR /&gt;&amp;nbsp;filename = pagename + ".png"&lt;BR /&gt;&amp;nbsp;print(filename)&lt;BR /&gt;&amp;nbsp;endlocation = os.path.join(relpath, filename)&lt;BR /&gt;&amp;nbsp;print(endlocation)&lt;BR /&gt;&amp;nbsp;l.exportToPNG(endlocation)&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jul 2021 18:57:55 GMT</pubDate>
    <dc:creator>ArthurKay</dc:creator>
    <dc:date>2021-07-23T18:57:55Z</dc:date>
    <item>
      <title>ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240096#M10451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to export my ArcGIS Pro map series to PNG.&amp;nbsp; I'm using the&amp;nbsp;MapSeries example code #2 from Esri (&lt;SPAN style="font-size: 11.0pt;"&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/mapseries-class.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/mapping/mapseries-class.htm&lt;/A&gt;&amp;nbsp;).&amp;nbsp; I keep getting an Invalid page number error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Any help is much appreciated!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 11.0pt; "&gt;See below code and error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 11.0pt; "&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os, sys&lt;BR /&gt;relpath = "Z:\\41708.02 VAGuidehouse - MAHSO Call 1\\300TIG\\315Maps\\Maps_DDF"&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;l = aprx.listLayouts()[0]&lt;BR /&gt;if not l.mapSeries is None:&lt;BR /&gt; ms = l.mapSeries&lt;BR /&gt; if ms.enabled:&lt;BR /&gt; for pageNum in range(1, ms.pageCount + 1):&lt;BR /&gt; ms.currentPageNumber = pageNum&lt;BR /&gt; print("layoutName{0}".format(ms.pageRow.Market))&lt;BR /&gt; pageName = ms.pageRow.Market&lt;BR /&gt; l.exportToPNG(relpath + "\\PNG_Test\\S7_MKTOVW_{0}".format(ms.pageRow.Market) + ".png")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 11.0pt; "&gt;Error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;string&amp;gt;", line 10, in &amp;lt;module&amp;gt;&lt;BR /&gt; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\arcobjects\_base.py", line 109, in _set&lt;BR /&gt; return setattr(self._arc_object, attr_name, cval(val))&lt;BR /&gt;ValueError: Invalid page number '1'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2019 17:10:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240096#M10451</guid>
      <dc:creator>ElizabethAyarbe</dc:creator>
      <dc:date>2019-02-25T17:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240097#M10452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello: I am also having this issue.&amp;nbsp; I think it has something to do with my Page Numbers being a combination of letters and numbers.&amp;nbsp; Were you able to resolve this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 18:05:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240097#M10452</guid>
      <dc:creator>Kara_Shindle</dc:creator>
      <dc:date>2019-05-28T18:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240098#M10453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;In Layout Properties&amp;gt;Optional Fields - I had a field selected that was text.&amp;nbsp; I believe this field needs to be numerical.&amp;nbsp; I set it to &amp;lt;None&amp;gt; and the above code worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Liz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 23:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240098#M10453</guid>
      <dc:creator>ElizabethAyarbe</dc:creator>
      <dc:date>2019-05-28T23:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240099#M10454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Elizabeth,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map Series page numbers can be alphanumeric.&amp;nbsp;Are you able to export pages using the page number field you want using the UI (i.e. not through ArcPy)?&amp;nbsp;&amp;nbsp;What kind of values do you have for field you want to use as the page number?&amp;nbsp; Do you have any characters that are not "standard" alphabet or numbers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 13:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240099#M10454</guid>
      <dc:creator>TomBole</dc:creator>
      <dc:date>2019-05-30T13:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240100#M10455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Elizabeth: I did get the page number section to work based on your comments, so thank you!&amp;nbsp; I'm actually now trying to export a range based off of the same ESRI sample.&amp;nbsp; I keep getting the error on accessing the row attribute, where it says&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;ValueError&lt;/SPAN&gt;: Type names and field names must be valid identifiers: 'Shape.STArea()'

frustrating!&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:04:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240100#M10455</guid>
      <dc:creator>Kara_Shindle</dc:creator>
      <dc:date>2021-12-11T12:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240101#M10456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Elizabeth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sorry for your frustrations.&amp;nbsp; Can you please provide the line of code that specifies the range?&amp;nbsp; Again, I think this may have to do with the field data types.&amp;nbsp; The Page_Range_String parameter does take a string as designed because we want you to be able to export ranges like "1, 3, 5-12" but the exporter needs numbers, not strings. Something like "i, iii, v-vii" can't be supported for a variety of reasons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One work-around, if&amp;nbsp;non numeric characters&amp;nbsp;are necessary for the dynamic text you want to display, is to create another numeric field in your index feature class that has the page order they way you need it in numeric order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI - I ran example 2 on my machine and it worked fine.&amp;nbsp; I then changed the page number field to one called "RomanNumerals" and reproduced your original issue.&amp;nbsp; I'm not familiar with how to reproduce your second ValueError.&amp;nbsp; You are welcome to send me your code / a project package to jbarrette@esri.com.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff (arcpy.mp team)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 14:48:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240101#M10456</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2019-05-30T14:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240102#M10457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if you're responding to me or Elizabeth.&amp;nbsp; I created a similiar post to her's here&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/234564-exportingtopdf-python-for-map-series"&gt;https://community.esri.com/thread/234564-exportingtopdf-python-for-map-series&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 14:57:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240102#M10457</guid>
      <dc:creator>Kara_Shindle</dc:creator>
      <dc:date>2019-05-30T14:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240103#M10458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I confused the posts/names.&amp;nbsp; Same intention to help.&amp;nbsp; I will look at your other post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 15:07:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240103#M10458</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2019-05-30T15:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240104#M10459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom:&amp;nbsp; Sorry for my late response.&amp;nbsp; At the time I posted I didn't need a page number so changing it to &amp;lt;none&amp;gt; was no big deal.&amp;nbsp; I now however would like to include text at the end of my map name to describe it better but not the same field as I use in the "Name Field." Can I add text as the page name?&amp;nbsp; I would like to add "15-f-West-589" where the last three numbers change.&amp;nbsp; I created a text field&amp;nbsp;in my index layer named "MapPageName" that includes what I would like to name my exports.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2019 23:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240104#M10459</guid>
      <dc:creator>InnovaAdministrator</dc:creator>
      <dc:date>2019-06-28T23:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240105#M10460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can set "MapPageName" as the &lt;STRONG&gt;Name Field&lt;/STRONG&gt; for the map series and then export the pages as &lt;STRONG&gt;Multiple PDF Files (page names).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/452024_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can use ArcPy.mp to export files with the names you specify. You can use the values or any fields in the index layer in which to contruct file names. See map series example 2 in&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/mapseries-class.htm"&gt;https://pro.arcgis.com/en/pro-app/arcpy/mapping/mapseries-class.htm&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2019 15:59:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/240105#M10460</guid>
      <dc:creator>TomBole</dc:creator>
      <dc:date>2019-07-01T15:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/1041035#M39015</link>
      <description>&lt;P&gt;I'm having the same error as Elizabeth.&amp;nbsp; How do I fix it?&amp;nbsp; Trying what she suggested of removing fields from the layout options didn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy, os, sys&lt;BR /&gt;relpath = "Z:\\Cart\\Users\\elaine\\Aviation_Maps\\Airport Directory\\Airport Directory"&lt;BR /&gt;p = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;l = p.listLayouts()[0]&lt;BR /&gt;if not l.mapSeries is None:&lt;BR /&gt;ms = l.mapSeries&lt;BR /&gt;if ms.enabled:&lt;BR /&gt;for pageNum in range(1, ms.pageCount + 1):&lt;BR /&gt;ms.currentPageNumber = pageNum&lt;BR /&gt;print("Exporting {0}".format(ms.pageRow.name))&lt;BR /&gt;pageName = ms.pageRow.name&lt;BR /&gt;l.exportToPNG(os.path.join(relpath, "PNG", f"Ex2_{ms.pageRow.name}.png"))&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 9, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 109, in _set&lt;BR /&gt;return setattr(self._arc_object, attr_name, cval(val))&lt;BR /&gt;ValueError: Invalid page number '1'.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 13:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/1041035#M39015</guid>
      <dc:creator>KansasDOT</dc:creator>
      <dc:date>2021-03-26T13:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/1082318#M43677</link>
      <description>&lt;P&gt;I'm late to the party but this thread was helpful to me, so thanks Elizabeth for making the post. I modified your script ever so slightly and it ran just fine for me. Here is the snippit that I used:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os, sys&lt;BR /&gt;relpath = r'''F:\0 - Ranking All Unknowns\insetmaps'''&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;for item in aprx.listLayouts():&lt;BR /&gt;&amp;nbsp;itemname = item.name&lt;BR /&gt;&amp;nbsp;print(itemname)&lt;/P&gt;&lt;P&gt;l = aprx.listLayouts()[5]&lt;BR /&gt;print(l.name)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ms = l.mapSeries&lt;BR /&gt;for pageNum in range(1, ms.pageCount + 1):&lt;BR /&gt;&amp;nbsp;ms.currentPageNumber = pageNum&lt;BR /&gt;&amp;nbsp;pagename = ms.pageRow.Invnum&lt;BR /&gt;&amp;nbsp;print("{}".format(pagename))&lt;BR /&gt;&amp;nbsp;filename = pagename + ".png"&lt;BR /&gt;&amp;nbsp;print(filename)&lt;BR /&gt;&amp;nbsp;endlocation = os.path.join(relpath, filename)&lt;BR /&gt;&amp;nbsp;print(endlocation)&lt;BR /&gt;&amp;nbsp;l.exportToPNG(endlocation)&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 18:57:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/1082318#M43677</guid>
      <dc:creator>ArthurKay</dc:creator>
      <dc:date>2021-07-23T18:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: ExporttoPNG Python for MapSeries</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/1513489#M86295</link>
      <description>&lt;P&gt;God bless you Elizabeth.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 09:14:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/exporttopng-python-for-mapseries/m-p/1513489#M86295</guid>
      <dc:creator>מנהלפורטל</dc:creator>
      <dc:date>2024-08-01T09:14:55Z</dc:date>
    </item>
  </channel>
</rss>

