Hello,
I have a python notebook that I've been running in Pro v3.0 that compares a handful of point feature classes to two different versions of a polygon feature class and tells me which points are not in the same polygon in both versions.
The problem I am having is after adding columns to the point feature classes (via arcpy.management.AddField), I keep getting a "Cannot acquire a lock" error when I try to calculate values into those fields. These feature classes are all in a file geodatabase that nobody else is using except me.
What do I need to do between the first CalculateField and the second to get this to work? It is the same feature class involved both times.
I use CalculateField many times elsewhere in the notebook but after arcpy.management.SelectLayerByLocation (or ByAttribute). This only is happening when it follows .AddField.
Here are the relevant sections of the notebook:
#adding the fields
arcpy.management.AddField(NewDlnLayer,DlnChangedField,"TEXT",field_length=1)
arcpy.management.AddField(NewDlnLayer,DlnOnParcelBorder,"TEXT",field_length=1)
#Calculating values into the fields
arcpy.management.CalculateField(NewDlnLayer,DlnChangedField,"'N'","PYTHON3")
arcpy.management.CalculateField(NewDlnLayer,DlnOnParcelBorder,"'N'","PYTHON3") #IT'S BEEN FAILING HERE
Thank you,
Mike