<?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 Unable to append feature to another feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/unable-to-append-feature-to-another-feature-class/m-p/755922#M58315</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The script below creates a buffer around a parcel in a feature class called 'tempBuffer'. This part works, except for an unrelated problem (creates buffers around all parcels, not just the selected one) I'll post in another thread if I can't figure it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that I can't then append the feature from tempBuffer to the Buffer feature class. The script and error messages are below. Nothing else is doing anything with Buffer, which in my test environment is limited by a definition query to the same case_numberanyway. Any ideas? Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: When run as a tool, and not from PyScripter, no error pops up. But, the Buffer attribute table in ArcMap doesn't show the new buffer, even after refreshing, while ArcCatalog does. Either way, it doesn't show in the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy
from arcpy import env

env.workspace = r"\\TestServer\TestCases_Geodatabase.gdb"
buffer_200 = "Buffer"

#-------------------------------------------------------------------------------
# Buffer Processing
#
def CreateBuffer():
&amp;nbsp;&amp;nbsp;&amp;nbsp; # set buffer parameters
&amp;nbsp;&amp;nbsp;&amp;nbsp; case = "Cases"
&amp;nbsp;&amp;nbsp;&amp;nbsp; output ="tempBuffer"
&amp;nbsp;&amp;nbsp;&amp;nbsp; dist = "200 feet"
&amp;nbsp;&amp;nbsp;&amp;nbsp; side = "OUTSIDE_ONLY"
&amp;nbsp;&amp;nbsp;&amp;nbsp; case_number = raw_input("Enter Case #")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete existing temporary buffer, if any
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(output):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(output)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create temporary buffer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis(case, output, dist, side)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # copy tempBuffer to Buffer feature class
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Starting Append..."
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(output, buffer_200, "NO_TEST", "First", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; except Exception as e:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Unable to copy temporary buffer to Buffer feature class"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print e.message
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Starting Append...
Unable to copy temporary buffer to Buffer feature class
ERROR 999999: Error executing function.
Cannot acquire a lock.
Cannot acquire a lock. [The table Buffer is being written by another process.]
Failed to execute (Append).
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2012 16:51:21 GMT</pubDate>
    <dc:creator>Zeke</dc:creator>
    <dc:date>2012-03-27T16:51:21Z</dc:date>
    <item>
      <title>Unable to append feature to another feature class</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-append-feature-to-another-feature-class/m-p/755922#M58315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The script below creates a buffer around a parcel in a feature class called 'tempBuffer'. This part works, except for an unrelated problem (creates buffers around all parcels, not just the selected one) I'll post in another thread if I can't figure it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that I can't then append the feature from tempBuffer to the Buffer feature class. The script and error messages are below. Nothing else is doing anything with Buffer, which in my test environment is limited by a definition query to the same case_numberanyway. Any ideas? Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: When run as a tool, and not from PyScripter, no error pops up. But, the Buffer attribute table in ArcMap doesn't show the new buffer, even after refreshing, while ArcCatalog does. Either way, it doesn't show in the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy
from arcpy import env

env.workspace = r"\\TestServer\TestCases_Geodatabase.gdb"
buffer_200 = "Buffer"

#-------------------------------------------------------------------------------
# Buffer Processing
#
def CreateBuffer():
&amp;nbsp;&amp;nbsp;&amp;nbsp; # set buffer parameters
&amp;nbsp;&amp;nbsp;&amp;nbsp; case = "Cases"
&amp;nbsp;&amp;nbsp;&amp;nbsp; output ="tempBuffer"
&amp;nbsp;&amp;nbsp;&amp;nbsp; dist = "200 feet"
&amp;nbsp;&amp;nbsp;&amp;nbsp; side = "OUTSIDE_ONLY"
&amp;nbsp;&amp;nbsp;&amp;nbsp; case_number = raw_input("Enter Case #")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete existing temporary buffer, if any
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(output):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(output)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create temporary buffer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis(case, output, dist, side)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # copy tempBuffer to Buffer feature class
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Starting Append..."
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(output, buffer_200, "NO_TEST", "First", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; except Exception as e:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Unable to copy temporary buffer to Buffer feature class"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print e.message
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Starting Append...
Unable to copy temporary buffer to Buffer feature class
ERROR 999999: Error executing function.
Cannot acquire a lock.
Cannot acquire a lock. [The table Buffer is being written by another process.]
Failed to execute (Append).
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 16:51:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-append-feature-to-another-feature-class/m-p/755922#M58315</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2012-03-27T16:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to append feature to another feature class</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-append-feature-to-another-feature-class/m-p/755923#M58316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you get the same error if your workspace is on a local drive instead of a server?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 17:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-append-feature-to-another-feature-class/m-p/755923#M58316</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2012-03-27T17:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to append feature to another feature class</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-append-feature-to-another-feature-class/m-p/755924#M58317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'll try that, but I'm thinking now that I don't actually need to keep the copy of the buffer. It was done that way previously, but once a series of maps are produced, I don't see a need to keep a copy of it around, especially when it can be reproduced at any time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to automate things for people in another department, but if they can get the maps they want, no need to stick with the way they were doing it. They'll never know, or have a need to know, how it's done.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 18:50:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-append-feature-to-another-feature-class/m-p/755924#M58317</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2012-03-27T18:50:54Z</dc:date>
    </item>
  </channel>
</rss>

