<?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 Model Builder Iterate layer files to PNG in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-iterate-layer-files-to-png/m-p/795051#M2926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For a comparison analysis of intersected polygon feature classes I am trying to export 253 layer files to a PNG image using the Model Builder.&lt;/P&gt;&lt;P&gt;Unfortunately the 'Iterate Files' tool in the Model Builder won't let me iterate through the the .lyr-files in the workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use the following arcpy tool in a script linked to the iterator:&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;mapping&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;ExportToPNG&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It gives me the following error, as a .lyr file is nothing more than a reference to symbology and a feature class. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;Failed to execute. Parameters are not valid.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;ERROR 000840: The value is not a File.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;Failed to execute (LayertoPNG).&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/31462/export-each-layer-in-map-to-a-separate-image" title="http://gis.stackexchange.com/questions/31462/export-each-layer-in-map-to-a-separate-image"&gt; &lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hopefully someone could help me out, as I couldn't make this script work either:&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/31462/export-each-layer-in-map-to-a-separate-image" title="http://gis.stackexchange.com/questions/31462/export-each-layer-in-map-to-a-separate-image"&gt;arcgis 10.0 - Export each layer in map to a separate image - Geographic Information Systems Stack Exchange&lt;/A&gt; &lt;/P&gt;&lt;P&gt;or:&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/16477/arcmap-save-all-layers-in-table-of-contents-to-layer-files" title="http://gis.stackexchange.com/questions/16477/arcmap-save-all-layers-in-table-of-contents-to-layer-files"&gt;python - Arcmap: save all layers in Table of Contents to layer files - Geographic Information Systems Stack Exchange&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2016 09:02:41 GMT</pubDate>
    <dc:creator>Henk_PieterSterk</dc:creator>
    <dc:date>2016-06-24T09:02:41Z</dc:date>
    <item>
      <title>Model Builder Iterate layer files to PNG</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-iterate-layer-files-to-png/m-p/795051#M2926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For a comparison analysis of intersected polygon feature classes I am trying to export 253 layer files to a PNG image using the Model Builder.&lt;/P&gt;&lt;P&gt;Unfortunately the 'Iterate Files' tool in the Model Builder won't let me iterate through the the .lyr-files in the workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use the following arcpy tool in a script linked to the iterator:&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;mapping&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;ExportToPNG&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It gives me the following error, as a .lyr file is nothing more than a reference to symbology and a feature class. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;Failed to execute. Parameters are not valid.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;ERROR 000840: The value is not a File.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;Failed to execute (LayertoPNG).&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/31462/export-each-layer-in-map-to-a-separate-image" title="http://gis.stackexchange.com/questions/31462/export-each-layer-in-map-to-a-separate-image"&gt; &lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hopefully someone could help me out, as I couldn't make this script work either:&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/31462/export-each-layer-in-map-to-a-separate-image" title="http://gis.stackexchange.com/questions/31462/export-each-layer-in-map-to-a-separate-image"&gt;arcgis 10.0 - Export each layer in map to a separate image - Geographic Information Systems Stack Exchange&lt;/A&gt; &lt;/P&gt;&lt;P&gt;or:&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/16477/arcmap-save-all-layers-in-table-of-contents-to-layer-files" title="http://gis.stackexchange.com/questions/16477/arcmap-save-all-layers-in-table-of-contents-to-layer-files"&gt;python - Arcmap: save all layers in Table of Contents to layer files - Geographic Information Systems Stack Exchange&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 09:02:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-iterate-layer-files-to-png/m-p/795051#M2926</guid>
      <dc:creator>Henk_PieterSterk</dc:creator>
      <dc:date>2016-06-24T09:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Iterate layer files to PNG</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-iterate-layer-files-to-png/m-p/795052#M2927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try creating an in-memory Layer file while iterating and working with that instead:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# list lyr files in workspace
lyrs = arcpy.ListFiles("*.lyr")
for l in lyrs:
&amp;nbsp; lyr = arcpy.mapping.Layer(arcpy.Describe(l).catalogPath)
&amp;nbsp; layers = arcpy.mapping.ListLayers(lyr)
&amp;nbsp; for layer in layers:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # process layer&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:10:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-iterate-layer-files-to-png/m-p/795052#M2927</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2021-12-12T09:10:30Z</dc:date>
    </item>
  </channel>
</rss>

