<?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: Model runs, Python export fails on append in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638568#M49798</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ben, Curtis. Thank you both for your replies and ideas. Let me taek a look at your suggestions (probably after the holiday) and post back with my results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciae your input!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Nov 2014 11:58:08 GMT</pubDate>
    <dc:creator>BugPie</dc:creator>
    <dc:date>2014-11-25T11:58:08Z</dc:date>
    <item>
      <title>Model runs, Python export fails on append</title>
      <link>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638565#M49795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;I'm trying to get a few models to run via python after being initialized from Windows Scheduler. (Windows Server 2008 r2, acrmap 10.1.1, python 2.7.2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;I have been able to get two of my models to run this way after exporting to python and setting windows scheduler to execute the python script. however, there is still one model that is failing, but &lt;STRONG&gt;only when run via python&lt;/STRONG&gt;. &lt;SPAN class="mceitemhidden"&gt;Runs successful from the model / toolbox in our Enterprise GDB, no problems at all. &lt;/SPAN&gt;I'm, not very versed in python so I can't really decipher what this error (below) means outside of the error code = append issue with mis-matched fields.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;The model that runs successfully, is using a table view, &lt;/SPAN&gt;&lt;SPAN class="mceitemhiddenspellword2"&gt;geocoding&lt;/SPAN&gt;&lt;SPAN class="mceitemhidden"&gt;, appending points to a feature class in our Enterprise &lt;/SPAN&gt;&lt;SPAN class="mceitemhiddenspellword2"&gt;GDB&lt;/SPAN&gt;&lt;SPAN class="mceitemhidden"&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;The model that fails is using a table view, plotting x/&lt;/SPAN&gt;&lt;SPAN class="mceitemhiddenspellword2"&gt;y&lt;/SPAN&gt;&lt;SPAN class="mceitemhidden"&gt;, appending points to a feature class in our Enterprise &lt;/SPAN&gt;&lt;SPAN class="mceitemhiddenspellword2"&gt;GDB&lt;/SPAN&gt;&lt;SPAN class="mceitemhidden"&gt;.This one seems to fail on the append. &lt;STRONG&gt;BUT only when run from python&lt;/STRONG&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mceitemhidden"&gt;Runs successful from the model / toolbox in our Enterprise GDB, just not from python shell. What is going on here, what ? anyone have insight? Please let me know if you need additional info from this tool or error. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fail message::&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 3560, in Append&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/P&gt;&lt;P&gt;ExecuteError: ERROR 000224: Cannot insert features&lt;/P&gt;&lt;P&gt;Failed to execute (Append).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 15:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638565#M49795</guid>
      <dc:creator>BugPie</dc:creator>
      <dc:date>2014-11-13T15:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Model runs, Python export fails on append</title>
      <link>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638566#M49796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try exporting the table view to a new feature class and then appending the features from the feature class. May be spatial reference related...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 01:12:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638566#M49796</guid>
      <dc:creator>BenNadler</dc:creator>
      <dc:date>2014-11-25T01:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Model runs, Python export fails on append</title>
      <link>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638567#M49797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can run a model from a python script directly, without export. Here's an (untested) script, assuming you have a toolbox named "MyToolbox" with a model named "MyModel".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ImportToolbox("c:/users/username/Documents/ArcGIS/MyToolbox.tbx", "mytools")
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MyModel_mytools("arg1", "arg2")
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(arcpy.GetMessages())
except Exception as msg:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError("Python messages:\n{}".format(msg))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError("ArcGIS messages:\n{}".format(arcpy.GetMessages()))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:08:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638567#M49797</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T03:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Model runs, Python export fails on append</title>
      <link>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638568#M49798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ben, Curtis. Thank you both for your replies and ideas. Let me taek a look at your suggestions (probably after the holiday) and post back with my results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciae your input!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 11:58:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638568#M49798</guid>
      <dc:creator>BugPie</dc:creator>
      <dc:date>2014-11-25T11:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Model runs, Python export fails on append</title>
      <link>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638569#M49799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to update our model so that after the plot XY from the table view, we are now using the "Copy Features" GP tool to create a copy and have set the spatial reference set to match the projected spatial reference of the feature class that we are appending too. Previously we were appending directly from the temp layer from plotting XY process.&amp;nbsp; After this change the append runs successfully!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*&lt;/STRONG&gt;one caveat, we are now seeing a mapped fields issue where the datetime field is not being written to during the append process, but that is for another thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Curtis:&lt;/STRONG&gt; I have not had time to test your solution, so I can't say that it is not the answer to this riddle. It may be. If I get around to testing it out, I will certainly post back here for others. I can see how this would come in use for other projects we have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 15:48:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-runs-python-export-fails-on-append/m-p/638569#M49799</guid>
      <dc:creator>BugPie</dc:creator>
      <dc:date>2014-12-05T15:48:27Z</dc:date>
    </item>
  </channel>
</rss>

