<?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: Exporting Layers to PNG using Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/exporting-layers-to-png-using-python/m-p/150883#M11675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use export to png:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002s000000" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002s000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this thread will help you, be sure and read the last thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/17136-Turn-layers-off-w-arcpy.mapping" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/17136-Turn-layers-off-w-arcpy.mapping&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will also need to set the extent inside the loop (you will need to save and close the mxd with all layers turned off):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not tested this so you might have to tinker with it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp; mxd = arcpy.mapping.MapDocument(r"C:\Maps\MakeMaps.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] #df name is "Layers" in this example for lyr in arcpy.mapping.ListLayers(mxd): &amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.visible = True&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ext = lyr.getExtent() &amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = ext &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPNG(mxd, r"C:\Maps\Exports\"&amp;nbsp; + lyr + ".png")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Apr 2014 23:29:59 GMT</pubDate>
    <dc:creator>AmyKlug</dc:creator>
    <dc:date>2014-04-14T23:29:59Z</dc:date>
    <item>
      <title>Exporting Layers to PNG using Python</title>
      <link>https://community.esri.com/t5/python-questions/exporting-layers-to-png-using-python/m-p/150882#M11674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi guys!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm pretty new to python and have a question about an automation i'm trying to achieve. Is it possible to export several layers to a specific file format (the module offers several) using python. For instance if i have two layers in my data frame (a point feature and a line feature) and i want to export these to PNG separately, I would normally turn off one layer and export the other. Then i would repeat the process again for the remaining layer. Hypothetically if I had 20 layers which I wanted to export this way it would be useful if I had the process automated. Is it possible to write a script that does this? I acknowledge the fact this might be comprehensive, but if it is possible then any "kickstarters" of code in the right direction would be appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you:)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 08:13:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporting-layers-to-png-using-python/m-p/150882#M11674</guid>
      <dc:creator>AqeelAhmed</dc:creator>
      <dc:date>2014-04-11T08:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting Layers to PNG using Python</title>
      <link>https://community.esri.com/t5/python-questions/exporting-layers-to-png-using-python/m-p/150883#M11675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use export to png:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002s000000" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002s000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this thread will help you, be sure and read the last thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/17136-Turn-layers-off-w-arcpy.mapping" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/17136-Turn-layers-off-w-arcpy.mapping&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will also need to set the extent inside the loop (you will need to save and close the mxd with all layers turned off):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not tested this so you might have to tinker with it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp; mxd = arcpy.mapping.MapDocument(r"C:\Maps\MakeMaps.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] #df name is "Layers" in this example for lyr in arcpy.mapping.ListLayers(mxd): &amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.visible = True&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ext = lyr.getExtent() &amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = ext &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPNG(mxd, r"C:\Maps\Exports\"&amp;nbsp; + lyr + ".png")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 23:29:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporting-layers-to-png-using-python/m-p/150883#M11675</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2014-04-14T23:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting Layers to PNG using Python</title>
      <link>https://community.esri.com/t5/python-questions/exporting-layers-to-png-using-python/m-p/150884#M11676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Use export to png:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002s000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002s000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;this thread will help you, be sure and read the last thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/17136-Turn-layers-off-w-arcpy.mapping" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/17136-Turn-layers-off-w-arcpy.mapping&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You will also need to set the extent inside the loop (you will need to save and close the mxd with all layers turned off):&lt;BR /&gt;I have not tested this so you might have to tinker with it.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
mxd = arcpy.mapping.MapDocument(r"C:\Maps\MakeMaps.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] #df name is "Layers" in this example
for lyr in arcpy.mapping.ListLayers(mxd):
&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.visible = True&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = lyr.getExtent()
&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = ext
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPNG(mxd, r"C:\Maps\Exports\"&amp;nbsp; + lyr + ".png")
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks! I'll give it a run &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:07:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporting-layers-to-png-using-python/m-p/150884#M11676</guid>
      <dc:creator>AqeelAhmed</dc:creator>
      <dc:date>2021-12-11T08:07:12Z</dc:date>
    </item>
  </channel>
</rss>

