<?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 Iterate Feature Selection equivalent in Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/iterate-feature-selection-equivalent-in-python/m-p/84680#M6672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made a tool in Model Builder that uses "Iterate Feature Selection" and I'm trying to figure out if there is an equivalent I can use in Python. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, the tool goes through each feature in my "Subdivision_Copy" feature class and groups by the field "Community" and exports each feature as a shapefile in a "Scratch_Shapefiles" folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19296[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm still learning Python and I'm not too sure how to go about doing this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Nov 2012 19:03:59 GMT</pubDate>
    <dc:creator>MargretAdaya</dc:creator>
    <dc:date>2012-11-14T19:03:59Z</dc:date>
    <item>
      <title>Iterate Feature Selection equivalent in Python</title>
      <link>https://community.esri.com/t5/python-questions/iterate-feature-selection-equivalent-in-python/m-p/84680#M6672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made a tool in Model Builder that uses "Iterate Feature Selection" and I'm trying to figure out if there is an equivalent I can use in Python. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, the tool goes through each feature in my "Subdivision_Copy" feature class and groups by the field "Community" and exports each feature as a shapefile in a "Scratch_Shapefiles" folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19296[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm still learning Python and I'm not too sure how to go about doing this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 19:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-feature-selection-equivalent-in-python/m-p/84680#M6672</guid>
      <dc:creator>MargretAdaya</dc:creator>
      <dc:date>2012-11-14T19:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Feature Selection equivalent in Python</title>
      <link>https://community.esri.com/t5/python-questions/iterate-feature-selection-equivalent-in-python/m-p/84681#M6673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I made a tool in Model Builder that uses "Iterate Feature Selection" and I'm trying to figure out if there is an equivalent I can use in Python. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you considered setting up your model as a script tool (with parameters), importing the toolbox using arcpy.ImportToolbox, and running the model from your Python script? If you're more comfortable with ModelBuilder - why not let it do the tricky stuff?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.ImportToolbox("Mytools.tbx","Model1")
arcpy.MyModel_mytools(input,output)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code to do this in Python would be complicated enough (especially if you are using several group by fields) that this may be a good approach for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could use the output of the Collect Values tool as an output parameter to pass the list of output datasets back to your python script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:15:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-feature-selection-equivalent-in-python/m-p/84681#M6673</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T23:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Feature Selection equivalent in Python</title>
      <link>https://community.esri.com/t5/python-questions/iterate-feature-selection-equivalent-in-python/m-p/84682#M6674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply! I'll try it out!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 17:10:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-feature-selection-equivalent-in-python/m-p/84682#M6674</guid>
      <dc:creator>MargretAdaya</dc:creator>
      <dc:date>2012-11-15T17:10:14Z</dc:date>
    </item>
  </channel>
</rss>

