AnsweredAssumed Answered

RuntimeError: start edit session

Question asked by bz89 on May 15, 2019
Latest reply on May 16, 2019 by bz89

For some reason when i try and start and stop an edit session the stop.Editing(True) does not work because it appears that an edit session was never started. See code snippet below:

 

workspace = os.path.dirname(shl_fc)

edit = arcpy.da.Editor(workspace)

edit.startEditing()
arcpy.AddMessage(isEditing)
edit.startOperation()

# Update SHL Geometry
with arcpy.da.UpdateCursor(shl_fc,[shl_dsu_field_name,shl_well_num_field_name,'SHAPE@XY']) as shl_updatecursor:
     for feature in shl_updatecursor:
          if dsu_name in feature[0] and well_num in feature[1]:
               projected_shl_coordinates = ProjectCoordinates(float(shl_coordinates[0]),float(shl_coordinates[1]),shl_coords_spatial_ref,shl_fc_spatial_ref)
               newrow = []
               newrow.append(feature[0])
               newrow.append(feature[1])
               newrow.append(projected_shl_coordinates)
               shl_updatecursor.updateRow(newrow)

edit.stopOperation()

edit.stopEditing(True)

 

Update: I added an 'AddMessage' statement to return the boolean value of '.isEditing' and it returns True.

Update 2: Adding the 'isEditing' before the '.startEditing' returns False.

Outcomes