<?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: Loop Layers in Modelbuilder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256469#M8787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No problem, Nina, anytime. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can find a lot of great examples of syntax for geoprocessing tools and arcpy functions from within our Resource Center.&amp;nbsp; Here are just a couple examples but you can use the search box to find much, much more:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.ListLayers&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002n000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002n000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.MapDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000000n000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000000n000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suggest to start with these two introduction pages below then use the navigational tree on the left side in both links to branch out into further topics:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is Python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_Python/002z00000001000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_Python/002z00000001000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is ArcPy?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_ArcPy/000v000000v7000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_ArcPy/000v000000v7000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Mar 2013 17:54:44 GMT</pubDate>
    <dc:creator>MatthewPayne</dc:creator>
    <dc:date>2013-03-22T17:54:44Z</dc:date>
    <item>
      <title>Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256462#M8780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there an easy way to loop through layers and perform an action on each one in Modelbuilder without writing a script?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 13:37:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256462#M8780</guid>
      <dc:creator>NinaRihn</dc:creator>
      <dc:date>2013-03-22T13:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256463#M8781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Nina,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you mention looping though layers, are you referring to layers in the table of contents of ArcMap or features within a geodatabase or shapefiles within a folder?&amp;nbsp; If you are referring to layers in the table of contents, are these layers in the same workspace or do they come from different workspaces?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 13:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256463#M8781</guid>
      <dc:creator>MatthewPayne</dc:creator>
      <dc:date>2013-03-22T13:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256464#M8782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;they are layers in the ArcMap TOC that are in different workspaces.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 16:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256464#M8782</guid>
      <dc:creator>NinaRihn</dc:creator>
      <dc:date>2013-03-22T16:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256465#M8783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nina,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can not loop through layers in the TOC of ArcMap using Model Builder because it would not have access to the data frame object as Model Builder was not designed for advanced processes.&amp;nbsp;&amp;nbsp; This would need to be done using scripting.&amp;nbsp; A quick, simple example going through the Python window of ArcPad would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; layers = arcpy.mapping.ListLayers(mxd)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; print layers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[&amp;lt;map layer u'CP_Test'&amp;gt;, &amp;lt;map layer u'points'&amp;gt;, &amp;lt;map layer u'polys'&amp;gt;, &amp;lt;map layer u'testlines'&amp;gt;, &amp;lt;map layer u'points'&amp;gt;, &amp;lt;map layer u'Arizona_Cities'&amp;gt;, &amp;lt;map layer u'Arizona_Cities'&amp;gt;]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 17:06:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256465#M8783</guid>
      <dc:creator>MatthewPayne</dc:creator>
      <dc:date>2013-03-22T17:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256466#M8784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Meant to type "ArcMap" and not "ArcPad" in the above post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 17:08:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256466#M8784</guid>
      <dc:creator>MatthewPayne</dc:creator>
      <dc:date>2013-03-22T17:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256467#M8785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Furthermore, the looping process with Python will be unique to your specific purpose.&amp;nbsp; In full, here is the example including a looping process that loops through and prints each layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; layers = arcpy.mapping.ListLayers(mxd)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; print layers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[&amp;lt;map layer u'CP_Test'&amp;gt;, &amp;lt;map layer u'points'&amp;gt;, &amp;lt;map layer u'polys'&amp;gt;, &amp;lt;map layer u'testlines'&amp;gt;, &amp;lt;map layer u'points'&amp;gt;, &amp;lt;map layer u'Arizona_Cities'&amp;gt;, &amp;lt;map layer u'Arizona_Cities'&amp;gt;]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; for lyr in layers:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print lyr&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CP_Test&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;points&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;polys&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;testlines&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;points&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arizona_Cities&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arizona_Cities&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 17:16:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256467#M8785</guid>
      <dc:creator>MatthewPayne</dc:creator>
      <dc:date>2013-03-22T17:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256468#M8786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks Matt!&amp;nbsp;&amp;nbsp; Looks like I better take some Python classes!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 17:34:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256468#M8786</guid>
      <dc:creator>NinaRihn</dc:creator>
      <dc:date>2013-03-22T17:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256469#M8787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No problem, Nina, anytime. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can find a lot of great examples of syntax for geoprocessing tools and arcpy functions from within our Resource Center.&amp;nbsp; Here are just a couple examples but you can use the search box to find much, much more:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.ListLayers&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002n000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002n000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.MapDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000000n000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000000n000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suggest to start with these two introduction pages below then use the navigational tree on the left side in both links to branch out into further topics:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is Python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_Python/002z00000001000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_Python/002z00000001000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is ArcPy?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_ArcPy/000v000000v7000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_ArcPy/000v000000v7000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 17:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256469#M8787</guid>
      <dc:creator>MatthewPayne</dc:creator>
      <dc:date>2013-03-22T17:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Layers in Modelbuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256470#M8788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings Nina!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In addition to all the excellent resources Matt pointed out here are some more resources on Python which might interest you:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) &lt;/SPAN&gt;&lt;A href="http://training.esri.com/gateway/index.cfm?fa=catalog.webCourseDetail&amp;amp;courseid=1868"&gt;Free training from Esri on Using Python in ArcGIS Desktop 10&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/communities/python/"&gt;Python for ArcGIS&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) A blog on &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/esri/supportcenter/2012/01/12/10-easy-ways-to-tame-python-scripting-in-arcgis/"&gt;10 Easy Ways to Tame Python Scripting in ArcGIS&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Happy learning.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Mar 2013 13:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/loop-layers-in-modelbuilder/m-p/256470#M8788</guid>
      <dc:creator>TarunJaiswal</dc:creator>
      <dc:date>2013-03-23T13:54:12Z</dc:date>
    </item>
  </channel>
</rss>

