<?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: ArcMap crashes using &amp;quot;ExportXYv_stats&amp;quot; command in loop in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779881#M1143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running it through the interactive Python window in ArcMap, using the "execfile(r'C:/path/program.py')" command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI, I've tried the same code on a different machine (same version of ArcMap), and it crashed on that computer as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT - to add to this, I tried running the program in two parts, one that created 100 sets of random points into 100 "merge" layers, and a second one that did the exporting step. No crash. Very strange, but at least I have a method to get the data that I need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Nov 2018 14:11:36 GMT</pubDate>
    <dc:creator>EliseosMucaki</dc:creator>
    <dc:date>2018-11-23T14:11:36Z</dc:date>
    <item>
      <title>ArcMap crashes using "ExportXYv_stats" command in loop</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779878#M1140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written a script using ArcPy commands that, in short, randomly generates points in several areas, merges them, adds XY coordinates to the merged points, and exports them with the "ExportXYv_stats" command. This script works perfectly fine if I run it once. However, whenever I try to add a 'for loop' to do this several times, ArcMap v10.4 crashes after completing the "Export" command. No error is visible before the crash occurs. Example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for x in range(0, 3):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ... (extraneous code)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; arcpy.AddXY_management(merge_name)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output_file = "Filename%d.txt" % x&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; arcpy.ExportXYv_stats(merge_name,"FID", "COMMA",output_file,"ADD_FIELD_NAMES")&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program crashes here. It will export the output file correctly, but the program completely halts afterwards (print statements placed immediately after the command do not get printed), and ArcMap crashes. If I comment out the export command, the program loops without issue. If I remove the loop, the program does not crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am at a loss of why this would be happening. Any suggestions would be appreciated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Nov 2018 22:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779878#M1140</guid>
      <dc:creator>EliseosMucaki</dc:creator>
      <dc:date>2018-11-22T22:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap crashes using "ExportXYv_stats" command in loop</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779879#M1141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sharing with &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌ since this is an ArcPy question and not an ArcGIS API for Python question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2018 13:06:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779879#M1141</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-11-23T13:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap crashes using "ExportXYv_stats" command in loop</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779880#M1142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you running this script?&amp;nbsp; In a tool, the interactive Python window in ArcMap, or outside of ArcMap completely?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2018 13:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779880#M1142</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-11-23T13:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap crashes using "ExportXYv_stats" command in loop</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779881#M1143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running it through the interactive Python window in ArcMap, using the "execfile(r'C:/path/program.py')" command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI, I've tried the same code on a different machine (same version of ArcMap), and it crashed on that computer as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT - to add to this, I tried running the program in two parts, one that created 100 sets of random points into 100 "merge" layers, and a second one that did the exporting step. No crash. Very strange, but at least I have a method to get the data that I need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2018 14:11:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcmap-crashes-using-quot-exportxyv-stats-quot/m-p/779881#M1143</guid>
      <dc:creator>EliseosMucaki</dc:creator>
      <dc:date>2018-11-23T14:11:36Z</dc:date>
    </item>
  </channel>
</rss>

