<?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: Python equivalent to Modelbuilder Iterator (Iterate) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-equivalent-to-modelbuilder-iterator-iterate/m-p/152837#M11790</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi danny,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can easily iterate over a list of feature classes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;example from the arcgis 10 help(&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000011000000):" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000011000000):&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
import os

# Set the workspace for the ListFeatureClass function
#
env.workspace = "c:/base"

# Use the ListFeatureClasses function to return a list of 
#&amp;nbsp; all shapefiles.
#
fcList = arcpy.ListFeatureClasses()

# Copy shapefiles to a file geodatabase
#
for fc in fcList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(fc, "d:/base/output.gdb" + os.sep + fc.rstrip(".shp"))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 08:11:38 GMT</pubDate>
    <dc:creator>RaphaelR</dc:creator>
    <dc:date>2021-12-11T08:11:38Z</dc:date>
    <item>
      <title>Python equivalent to Modelbuilder Iterator (Iterate)</title>
      <link>https://community.esri.com/t5/python-questions/python-equivalent-to-modelbuilder-iterator-iterate/m-p/152836#M11789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I often use iterate feature class and other iterations in modelbuilder. Can I replicate that easily in Python? It doesn't export the code so I have no template on how to create a .py script that does the same geoprocessing to every feature class in a feature dataset, for example.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I apologize if this was posted already but I could not find it using the Search Forums tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Danny&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2011 20:06:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-equivalent-to-modelbuilder-iterator-iterate/m-p/152836#M11789</guid>
      <dc:creator>DanielSheehan</dc:creator>
      <dc:date>2011-09-15T20:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python equivalent to Modelbuilder Iterator (Iterate)</title>
      <link>https://community.esri.com/t5/python-questions/python-equivalent-to-modelbuilder-iterator-iterate/m-p/152837#M11790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi danny,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can easily iterate over a list of feature classes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;example from the arcgis 10 help(&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000011000000):" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00000011000000):&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
import os

# Set the workspace for the ListFeatureClass function
#
env.workspace = "c:/base"

# Use the ListFeatureClasses function to return a list of 
#&amp;nbsp; all shapefiles.
#
fcList = arcpy.ListFeatureClasses()

# Copy shapefiles to a file geodatabase
#
for fc in fcList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(fc, "d:/base/output.gdb" + os.sep + fc.rstrip(".shp"))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:11:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-equivalent-to-modelbuilder-iterator-iterate/m-p/152837#M11790</guid>
      <dc:creator>RaphaelR</dc:creator>
      <dc:date>2021-12-11T08:11:38Z</dc:date>
    </item>
  </channel>
</rss>

