<?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: Select by location &amp;gt; list of objects in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880842#M1234</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can export the table contents as a text file&amp;nbsp;manually, but there is no script tool that exists. However, the python code for this process does exist, but you will need to code and set up the parameters yourself. The following documentation should help you get started:&amp;nbsp;&lt;A href="https://support.esri.com/en/technical-article/000011842"&gt;https://support.esri.com/en/technical-article/000011842&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But to extract the contents to text manually, you can follow the steps in the following documentation.&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.6/manage-data/tables/exporting-tables.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.6/manage-data/tables/exporting-tables.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Be sure to select the version of ArcMap you are using at the top to ensure the correct steps are provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this points you in the right direction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Aug 2019 23:24:21 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2019-08-05T23:24:21Z</dc:date>
    <item>
      <title>Select by location &gt; list of objects</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880841#M1233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to extract a list of selected objects from several layers to text file. Is there any script or toolbox available?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="/legacyfs/online/455251_List of selected objects.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2019 14:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880841#M1233</guid>
      <dc:creator>AidosMalybayev</dc:creator>
      <dc:date>2019-08-05T14:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select by location &gt; list of objects</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880842#M1234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can export the table contents as a text file&amp;nbsp;manually, but there is no script tool that exists. However, the python code for this process does exist, but you will need to code and set up the parameters yourself. The following documentation should help you get started:&amp;nbsp;&lt;A href="https://support.esri.com/en/technical-article/000011842"&gt;https://support.esri.com/en/technical-article/000011842&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But to extract the contents to text manually, you can follow the steps in the following documentation.&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.6/manage-data/tables/exporting-tables.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.6/manage-data/tables/exporting-tables.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Be sure to select the version of ArcMap you are using at the top to ensure the correct steps are provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this points you in the right direction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2019 23:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880842#M1234</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-08-05T23:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select by location &gt; list of objects</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880843#M1235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since this is the ModelBuilder space, I thought I'd go ahead and&amp;nbsp;provide&amp;nbsp;some code to use&amp;nbsp;with&amp;nbsp;the Calculate Value tool that would do this.&amp;nbsp; This assumes you have model elements named 'Feature layer', 'Field', and 'Output text file'. If 'Feature layer' has a selection active on it, only field values from the selected rows would be written to the text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE&lt;/STRONG&gt; added needed trailing new lines and return value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# Expression&lt;/SPAN&gt;
f&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"%Feature layer%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"%Field%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"%Output text file%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Code Block&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;f&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; textfile&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;# extract data to a list of text strings (with trailing newlines)&lt;/SPAN&gt;
  lst &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; rows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
      lst&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; chr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;# unique-ize and sort the list&lt;/SPAN&gt;
  lst &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sorted&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;list&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;set&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;# write to file&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; open&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;textfile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"w"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;writelines&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; textfile

&lt;SPAN class="comment token"&gt;# Data Type&lt;/SPAN&gt;
File
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 11:07:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880843#M1235</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T11:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select by location &gt; list of objects</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880844#M1236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;Currently I've got list in 1 row (e.g FairfieldHartfordLitchfieldMiddlesex.....)&lt;/P&gt;&lt;P&gt;is it possible to gel list in separate row for each object?&lt;/P&gt;&lt;P&gt;(&lt;SPAN&gt;e.g&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Fairfield&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hartford&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Litchfield&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Middlesex.....)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 13:49:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880844#M1236</guid>
      <dc:creator>AidosMalybayev</dc:creator>
      <dc:date>2019-08-06T13:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Select by location &gt; list of objects</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880845#M1237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, look above for an update, I modified the code to add the newlines (chr(10)) for you. (Unfortunately you can't use "\n" inside a Calculate Value code block you need to use chr(10) instead.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 15:44:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880845#M1237</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2019-08-06T15:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select by location &gt; list of objects</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880846#M1238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks, now it works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2019 12:06:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/select-by-location-gt-list-of-objects/m-p/880846#M1238</guid>
      <dc:creator>AidosMalybayev</dc:creator>
      <dc:date>2019-08-12T12:06:28Z</dc:date>
    </item>
  </channel>
</rss>

