<?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: I am getting an error &amp;quot;Cannot acquire a lock&amp;quot; when trying to calculate values in multiple fields. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118107#M9285</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;latlongref....&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-geometry-attributes.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-geometry-attributes.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Use 'raw' formatting (the little 'r') ... plus... provide the rest of the path, it is incomplete&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;latLonRef =&lt;STRONG&gt; r&lt;/STRONG&gt;"????????Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2018 15:49:59 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-04-20T15:49:59Z</dc:date>
    <item>
      <title>I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118094#M9272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I have created a script that adds 6 fields to a shapefile: Situs_city, Situs_St, Situs_Zip, Latitude, Longitude, and GIS_Acres. Further, the script is set to calculate the values for the Latitude, Longitude, and GIS_Acres fields. The script will work fine until after creating the GIS_acres field. Once this field is created the next step is to calculate and that is when I get an Error 999999: cannot acquire a lock. The weird aspect is once in a while the script will run all the way through just fine... anyway, I am stumped. I am pretty new to creating python scripts. If anyone has a suggestion that would be awesome. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/402462_pastedImage_1.png" style="width: 738px; height: 399px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Step 1&amp;nbsp; -&amp;nbsp; Copy new [Taxlots_TEST_DeleteME.shp] from \\cove\Department Shares\Common\Assessor\ArcGIS to E:\STAGING (IKRIT)&lt;BR /&gt;#set variables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in_data = "S:\Common\Assessor\ArcGIS\Taxlots_TEST_DeleteME.shp"&lt;BR /&gt;Shapefile = "E:\\STAGING\\Taxlots_TEST_DeleteME.shp"&lt;BR /&gt;#out_data = "E:\STAGING\Taxlots_TEST_DeleteME.shp"&lt;BR /&gt;arcpy.Copy_management(in_data, Shapefile)&lt;BR /&gt;print "Step 1 complete"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Step 2: Add Situs fields&lt;BR /&gt;# Create a new field - Situs_City (string, 25)&lt;BR /&gt;arcpy.AddField_management(Shapefile, "Situs_City", "TEXT", "","","25","","NULLABLE","NON_REQUIRED","")&lt;BR /&gt;print "Step 2a: Add Situs_City complete."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Create a new field - Situs_St (string, 2)&lt;BR /&gt;arcpy.AddField_management(Shapefile, "Situs_St", "TEXT", "#", "#", "2", "#", "NULLABLE", "NON_REQUIRED", "#")&lt;BR /&gt;print "Step 2b: Add Situs_St complete."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Create a new field - Situs_Zip (string, 10)&lt;BR /&gt;arcpy.AddField_management(Shapefile, "Situs_Zip", "TEXT", "#", "#", "10", "#", "NULLABLE", "NON_REQUIRED", "#")&lt;BR /&gt;print "Step 2c: Add Situs_Zip complete."&lt;BR /&gt;print "Step 2: Create situs fields complete."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Step 3: Create and calculate Latitude and Longitude fields.&lt;BR /&gt;latLonRef = "Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"&lt;BR /&gt;Taxlot_shp = "E:\STAGING\Taxlots_TEST_DeleteME.shp"&lt;BR /&gt;featureClassesList = Taxlot_shp.split(";")&lt;BR /&gt;field_Type = "DOUBLE"&lt;BR /&gt;field_precision_1 = 12&lt;BR /&gt;field_scale_1 = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for featureClass in featureClassesList:&lt;BR /&gt;&amp;nbsp;arcpy.AddMessage("Calculating XY coordinates for: " + featureClass)&lt;BR /&gt;&amp;nbsp;arcpy.AddField_management(featureClass, "Latitude", field_Type, field_precision_1, field_scale_1)&lt;BR /&gt;&amp;nbsp;arcpy.AddField_management(featureClass, "Longitude", field_Type, field_precision_1, field_scale_1)&lt;BR /&gt;&amp;nbsp;rows = arcpy.UpdateCursor(featureClass, "", latLonRef)&lt;BR /&gt;for row in rows:&lt;BR /&gt;&amp;nbsp;feat = row.getValue("shape")&lt;BR /&gt;&amp;nbsp;cent = feat.centroid&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # To get the polygon area: cent = feat.area&lt;BR /&gt;&amp;nbsp;row.Latitude = cent.Y&lt;BR /&gt;&amp;nbsp;row.Longitude = cent.X&lt;BR /&gt;&amp;nbsp;rows.updateRow(row)&lt;BR /&gt;&amp;nbsp; #arcpy.AddMessage(str(lat) + ", " + str(lon))&lt;BR /&gt;print "Step 3: Add Lat and Long complete"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Step 4: Create a new field - GIS_Acres (Double, 15, 3)&lt;BR /&gt;Shapefile3 = "E:\STAGING\Taxlots_TEST_DeleteME.shp"&lt;BR /&gt;#Set local variables&lt;BR /&gt;field_Name = "GIS_Acres"&lt;BR /&gt;field_Type = "DOUBLE"&lt;BR /&gt;field_Precision = 15 #total number of digits stored&lt;BR /&gt;field_Scale = 4 #number of decimals places&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.AddField_management(Shapefile3, field_Name, field_Type, field_Precision, field_Scale)&lt;BR /&gt;arcpy.CalculateField_management(Shapefile3, field_Name, '!SHAPE.area@ACRES!', "PYTHON_9.3")&lt;BR /&gt;print "Step 4: Calculate acres complete"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print "Congratulations! You have completed adding fields to to the Taxlots feature class. "&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 17:36:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118094#M9272</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2018-04-19T17:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118095#M9273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could be due to the fact that the Shapefile variable and the Taxlot_shp are referencing the same file.&amp;nbsp; Try deleting references to them or just reuse the variable name and make sure that that shapefile isn't within the 'for featureclasses' loop because being referenced several times within one script will certainly cause locks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 17:54:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118095#M9273</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-04-19T17:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118096#M9274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is it's something with your cursor that is placing a lock.&amp;nbsp; Instead of calculating the Latitude/Longitude I would use the &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-xy-coordinates.htm"&gt;Add XY Coordinates&lt;/A&gt; function.&amp;nbsp; This will create two fields POINT_X and POINT_Y with the latitude and longitude.&amp;nbsp; You can then rename these fields use the Rename function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your data is not in a Geographic Coordinate System you can set the &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/environments/output-coordinate-system.htm"&gt;Output Coordinate System&lt;/A&gt; Environment Variable.&amp;nbsp; Ex:&lt;CODE&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outputCoordinateSystem &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also recommend working with a feature class than a shapefile.&amp;nbsp; This provides much more functionality.&amp;nbsp; A couple other notes.&amp;nbsp; If you are going to use a cursor, use the &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/updatecursor-class.htm"&gt;arcpy.da.UpdateCursor&lt;/A&gt;.&amp;nbsp; These cursors are 10x faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also wanted to give you the following &lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-8691-posting-code-with-syntax-highlighting-on-geonet"&gt;link &lt;/A&gt;that discusses how to post code.&amp;nbsp; It makes it much easier for others to read.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 17:58:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118096#M9274</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-04-19T17:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118097#M9275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried doing the script with a single variable for the whole script and had the same problem and thought that if I recalled the file at each stage it might get rid of the lock. Sounds like I can revert back to that. I am not sure how to eliminate multiple uses of the shapefile in the loop. Suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob Noyes&lt;/P&gt;&lt;P&gt;GIS Analyst&lt;/P&gt;&lt;P&gt;Josephine County&lt;/P&gt;&lt;P&gt;541-474-5244&lt;/P&gt;&lt;P&gt;GIS Webpage&amp;lt;http://www.co.josephine.or.us/SectionIndex.asp?SectionID=129&amp;gt;&lt;/P&gt;&lt;P&gt;rnoyes@co.josephine.or.us&amp;lt;mailto:rnoyes@co.josephine.or.us&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;“A road map always tells you everything, except how to refold it&amp;lt;http://thinkexist.com/quotation/a_road_map_always_tells_you_everything_except_how/156219.html&amp;gt;” unknown&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 18:02:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118097#M9275</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2018-04-19T18:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118098#M9276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have opened an UpdateCursor&amp;nbsp;and looped through the records which is applying a lock to your data before you do the calculation and have not closed the cursor.&amp;nbsp; You need to delete the row variable at the end of the statements inside the for loop and delete the rows variable outside of the for&amp;nbsp;loop after the for loop is completed.&amp;nbsp;&amp;nbsp;You also should have used the da UpateCursor, which performs much quicker and includes a&amp;nbsp;With syntax that closes the cursor automatically once the cursor has been read or statements are executed at the same indent level as the With&amp;nbsp;declaration.&amp;nbsp; If this was my code, I would restructure the code to do all of the AddField operations before doing any updateCursor or Field Calculation operations to be safe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 18:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118098#M9276</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2018-04-19T18:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118099#M9277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will check out your suggestions. I did try initially copying the shapefile to a feature class but the lat long function took over a half hour to calculate and I would get the error for acquiring a lock. When trying the arcpy.da.UpdateCursor&amp;lt;https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Farcmap%2F10.3%2Fanalyze%2Farcpy-data-access%2Fupdatecursor-class.htm&amp;gt; I got a sql error. Perhaps that was because I was working with a shapefile at that point? Anyway, thanks for the link to posting code and the suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob Noyes&lt;/P&gt;&lt;P&gt;GIS Analyst&lt;/P&gt;&lt;P&gt;Josephine County&lt;/P&gt;&lt;P&gt;541-474-5244&lt;/P&gt;&lt;P&gt;GIS Webpage&amp;lt;http://www.co.josephine.or.us/SectionIndex.asp?SectionID=129&amp;gt;&lt;/P&gt;&lt;P&gt;rnoyes@co.josephine.or.us&amp;lt;mailto:rnoyes@co.josephine.or.us&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;“A road map always tells you everything, except how to refold it&amp;lt;http://thinkexist.com/quotation/a_road_map_always_tells_you_everything_except_how/156219.html&amp;gt;” unknown&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 18:08:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118099#M9277</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2018-04-19T18:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118100#M9278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the feedback. Sounds like I need to revert back to coping from a shapefile first then doing the other processes. I mentioned above that using the arcpy.da.updateCurser I got an error but I am wondering if that is due to my working with a shapefile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob Noyes&lt;/P&gt;&lt;P&gt;GIS Analyst&lt;/P&gt;&lt;P&gt;Josephine County&lt;/P&gt;&lt;P&gt;541-474-5244&lt;/P&gt;&lt;P&gt;GIS Webpage&amp;lt;http://www.co.josephine.or.us/SectionIndex.asp?SectionID=129&amp;gt;&lt;/P&gt;&lt;P&gt;rnoyes@co.josephine.or.us&amp;lt;mailto:rnoyes@co.josephine.or.us&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;“A road map always tells you everything, except how to refold it&amp;lt;http://thinkexist.com/quotation/a_road_map_always_tells_you_everything_except_how/156219.html&amp;gt;” unknown&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 18:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118100#M9278</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2018-04-19T18:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118101#M9279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For geometry etc... sounds like a job for Pro...&lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-fields.htm"&gt;&lt;STRONG&gt; Calculate Fields&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 18:16:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118101#M9279</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-04-19T18:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118102#M9280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Upon further investigation, i.e., looking at the link you sent, that code if for point and I am trying to get the xy coordinates for polygon centroids.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob Noyes&lt;/P&gt;&lt;P&gt;GIS Analyst&lt;/P&gt;&lt;P&gt;Josephine County&lt;/P&gt;&lt;P&gt;541-474-5244&lt;/P&gt;&lt;P&gt;GIS Webpage&amp;lt;http://www.co.josephine.or.us/SectionIndex.asp?SectionID=129&amp;gt;&lt;/P&gt;&lt;P&gt;rnoyes@co.josephine.or.us&amp;lt;mailto:rnoyes@co.josephine.or.us&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;“A road map always tells you everything, except how to refold it&amp;lt;http://thinkexist.com/quotation/a_road_map_always_tells_you_everything_except_how/156219.html&amp;gt;” unknown&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 21:30:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118102#M9280</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2018-04-19T21:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118103#M9281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your suggestion to create the fields first seem like a good plan so I have done that. However, since the script to calculate the lat and long for the polygon centroids was one I stole I am not quite sure how to revise it to read the created fields. Any ideas?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

&lt;SPAN class="comment token"&gt;#Step 1: Copy S:\Common\Assessor\ArcGIS\Taxlots_TEST_DeleteME.shp to Joco A assessor&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#Set Variables&lt;/SPAN&gt;
in_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"S:\Common\Assessor\ArcGIS\Taxlots_TEST_DeleteME.shp"&lt;/SPAN&gt;
out_database &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Database Connections/jocoA_Staging.sde/jocoA_Staging.DBO.Assessor"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Copy &lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureClassToGeodatabase_conversion&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_data&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;out_database&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 1: Copy complete."&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Step 2: Add Situs fields&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#Set variables&lt;/SPAN&gt;
out_fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Database Connections/jocoA_Staging.sde/jocoA_Staging.DBO.Assessor/jocoA_Staging.DBO.Taxlots_TEST_DeleteME"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Step 2a: Create a new field - Situs_City (string, 25)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Situs_City"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"25"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 2a: Add Situs_City complete."&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create a new field - Situs_St (string, 2)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Situs_St"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 2b: Add Situs_St complete."&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create a new field - Situs_Zip (string, 10)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Situs_Zip"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 2c: Add Situs_Zip complete."&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 2: adding the Situs fields has been successful!"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Step 3a: add Latitude (double, 12, 8)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Latitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DOUBLE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"12"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"8"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 3a: Add Latitude is completed."&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# # Step 3b: add Longitude (double, 12, 8)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Longitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DOUBLE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"12"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"8"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 3b: Add Longitude is completed"&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 3: adding the Latitude and Longitude fields has been successful!"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# # Step 4a: add GIS_Acres (double, 15, 4)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GIS_Acres"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DOUBLE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"15"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 4: Add GIS_Acres field completed."&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Step 5: Calculate GIS_Acres&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GIS_Acres"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'!SHAPE.area@ACRES!'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 5 Acres have been calculated."&lt;/SPAN&gt;



&lt;SPAN class="comment token"&gt;# Step 4: calculate Latitude and Longitude fields.&lt;/SPAN&gt;
latLonRef &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"&lt;/SPAN&gt;

featureClassesList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; out_fc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;";"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
field_Type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DOUBLE"&lt;/SPAN&gt;
field_precision_1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;12&lt;/SPAN&gt;
field_scale_1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;8&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; featureClass &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; featureClassesList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Calculating XY coordinates for: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; featureClass&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureClass&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Latitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_Type&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_precision_1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_scale_1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureClass&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Longitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_Type&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_precision_1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_scale_1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 rows &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureClass&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; latLonRef&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;
 feat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"shape"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 cent &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;centroid
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# To get the polygon area: cent = feat.area&lt;/SPAN&gt;
 row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Latitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y
 row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Longitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X
 rows&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="comment token"&gt;#arcpy.AddMessage(str(lat) + ", " + str(lon))&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 4: Add Lat and Long complete"&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Congratulations! You have completed adding and calculating the necessary fields to the Taxlots feature class. "&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;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;/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>Sat, 11 Dec 2021 06:55:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118103#M9281</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2021-12-11T06:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118104#M9282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In you step 3a and 3b you are adding the Latitude and Longitude fields, so you should not need to add them again in lines 57/58.&amp;nbsp; But I also do not think you need to have a cursor to get this info sine it looks like you out_fc and therefore your featureClassesList is only one feature class.&amp;nbsp; Is that correct?&amp;nbsp; Or do you plan to have a list of FC to process at come point?&amp;nbsp; if you will eventually have a list of fc that you will input, then don't add them in 3a and 3b....howevere, you may not need to add them at all..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the tool&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-xy-coordinates.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-xy-coordinates.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Add XY Coordinates—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; Jake recommended, that&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Adds the fields&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d; background-color: #fefefe; font-size: 14px;"&gt;POINT_X&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d; background-color: #fefefe; font-size: 14px;"&gt;POINT_Y&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to the point input features and calculates their values"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;But you said your features are polygons.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I think a better option for you if you are looking for the centroids is to use this tool&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-geometry-attributes.htm" title="https://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-geometry-attributes.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Add Geometry Attributes—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; &amp;nbsp;which&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;Adds new attribute fields to the input features representing the spatial or geometric characteristics and location of each feature, such as length or area and x-, y-, z-, and m-coordinates.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-size: 15px;"&gt;Syntax:
AddGeometryAttributes_management (Input_Features, Geometry_Properties, {Length_Unit}, {Area_Unit}, {Coordinate_System})&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;There is a long list of "Geometry_Properties" types that you can request.&amp;nbsp; &amp;nbsp; These is no need to "calculate" these fields if there is a tools that will do it for you, unless there is a reason (school assignment or if input to another tool step that will need this).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One comment about the AddGeometryAttibutes tool that I ran into in 10.2.2, if you cal a projected coord to geography and then back, there may be some small round off error.&amp;nbsp; Not significant, but for our Albers to geometry to Albers (I won't go into why I had to do this), there was a slight different.&amp;nbsp; Nothing that was measurable for what we were doing (small planes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118104#M9282</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-11T06:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118105#M9283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for responding! The code in lines 48-67 was from the old configuration I put together and I am not sure how to rewrite it to just calculate the Latitude and longitude fields. My goal is to do in the script what I would do if I right clicked on that field in the attribute table and ran the calculate geometry tool for the x and y coordinates using the wgs84  coordinate system. Nothing fancy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your add geometry attributes suggestion looks like just the thing! I will give it a shot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob Noyes&lt;/P&gt;&lt;P&gt;GIS Analyst&lt;/P&gt;&lt;P&gt;Josephine County&lt;/P&gt;&lt;P&gt;541-474-5244&lt;/P&gt;&lt;P&gt;GIS Webpage&amp;lt;http://www.co.josephine.or.us/SectionIndex.asp?SectionID=129&amp;gt;&lt;/P&gt;&lt;P&gt;rnoyes@co.josephine.or.us&amp;lt;mailto:rnoyes@co.josephine.or.us&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;“A road map always tells you everything, except how to refold it&amp;lt;http://thinkexist.com/quotation/a_road_map_always_tells_you_everything_except_how/156219.html&amp;gt;” unknown&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:02:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118105#M9283</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2018-04-20T13:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118106#M9284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I am feeling a bit dense here.... It might be obvious that I am not a programmer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; but using the syntax for the Add Geometry Tool I get:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;#Set variable&lt;/SPAN&gt;
out_fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Database Connections/jocoA_Staging.sde/jocoA_Staging.DBO.Assessor/jocoA_Staging.DBO.Taxlots_TEST_DeleteME"&lt;/SPAN&gt;
latLonRef &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#set workspace&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Database Connections/jocoA_Staging.sde/jocoA_Staging.DBO.Assessor/jocoA_Staging.DBO.Taxlots_TEST_DeleteME"&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#populate Latitude field&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddGeometryAttributes_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Latitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CENTROID_INSIDE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; latLonRef&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step complete"&lt;/SPAN&gt;
&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you might guess I get an error:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;Runtime error&amp;nbsp; Traceback (most recent call last):&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 22, in &amp;lt;module&amp;gt;&amp;nbsp;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 2170, in AddGeometryAttributes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e ExecuteError: ERROR 000622: Failed to execute (Add Geometry Attributes). Parameters are not valid. ERROR 000628: Cannot set input into parameter Coordinate_System.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two (perhaps more) things come to mind: 1) env.workspace to a feature class may not be copacetic and 2) I am not calling the latitude field correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original way I had this coded worked fine when ran separately but in the script with the other components it would get the lock error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:55:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118106#M9284</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2021-12-11T06:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118107#M9285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;latlongref....&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-geometry-attributes.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-geometry-attributes.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Use 'raw' formatting (the little 'r') ... plus... provide the rest of the path, it is incomplete&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;latLonRef =&lt;STRONG&gt; r&lt;/STRONG&gt;"????????Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 15:49:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118107#M9285</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-04-20T15:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118108#M9286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I’m writing on an iPad so may have typos.p or bad spacing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few things. &amp;nbsp;The first argument for the command is the input feature, not a field name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The command will ADD new fields based on the second argument&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;AddGeometryAttributes_management&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(out_fc, &lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;"CENTROID_INSIDE"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;""&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;,&lt;/SPAN&gt; latLonRef&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to copy you few records from the feature class to a temp file geodatabase (fgdb) and test that first. &amp;nbsp;SDE may add some restrictions for other reasons (permissions, locks). &amp;nbsp;Get it worked in the fgdb so you can see the logic,&amp;nbsp;then try it on a copy in&amp;nbsp;sde. &amp;nbsp;I think once you see how it adds the field it will make more sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:55:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118108#M9286</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-11T06:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118109#M9287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gold star for you! I was wondering about the file geodatabase vs SDE and was considering trying it with the FGDB. You motivated me. I set up a feature dataset in wgs 84 since I was having errors with the projection portion of the script, even after Dan's reminder to type in a complete path (doh!). Here is what I came up with:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#Set variable&lt;/SPAN&gt;
out_fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"E:\STAGING\Taxlots_staging.gdb\Staging\Taxlots_TEST_DeleteME"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#latLonRef = "E:\Coordinate_System\World\WGS 1984.prj"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#set workspace&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"E:\STAGING\Taxlots_staging.gdb\Staging"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Step 1: populate Latitude field&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddGeometryAttributes_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CENTROID_INSIDE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 1 complete"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Step 2: Rename INSIDE_X to Longitude&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AlterField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"INSIDE_X"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Longitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Longitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 2 complete"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Step 3: Rename INSIDE_Y to Latitude&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AlterField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"INSIDE_Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Latitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Latitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Step 3 complete"&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:55:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118109#M9287</guid>
      <dc:creator>BobNoyes</dc:creator>
      <dc:date>2021-12-11T06:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting an error "Cannot acquire a lock" when trying to calculate values in multiple fields.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118110#M9288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad you were able to resolve your issue. Remember to mark all helpful comments and then one as answered or a if none, then mark as assumed answered. That will close this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Apr 2018 17:13:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-getting-an-error-quot-cannot-acquire-a-lock/m-p/118110#M9288</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2018-04-29T17:13:18Z</dc:date>
    </item>
  </channel>
</rss>

