Overwrite MinimumBoundingGeometry

290
2
06-27-2022 01:23 PM
haslam33
New Contributor

I am attempting to use a Python script to update the contents of a .GDB file. I have two layers. The first is called Customers, which is a bunch of points plotted on a map. The second is CustomersZone, which uses the MinimumBoundingGeometry geoprocessing function to create a circle associated with the customer points.

The Python script uses a cursor to plot the points. Even if the project is open in ArcGIS Pro, the script always successfully updates the Customers layer.

However, if I have the project open in ArcGIS Pro, the command I use to populate CustomersZone fails. Here is the command:

arcpy.management.MinimumBoundingGeometry(r'Customers',r'CustomersZone','CIRCLE','LIST','IncidentID')

 

And here is the error:

arcgisscripting.ExecuteError: ERROR 000258: Output C:\Users\Projects\MyProject\MyProject.gdb\CustomersZone already exists
Failed to execute (MinimumBoundingGeometry).

 

I already have arcpy.env.overwriteOutput = True in my script, so it's not that. The "Allow geoprocessing tools to overwrite existing datasets" option is also checked for this project inside of ArcGIS Pro. Just wondering why I'd always be able to successfully get the points to update but why I can't update the CustomersZone layer using the MinimumBoundingGeometry geoprocessing function.

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

If what you are trying to overwrite is in a map, or its table is open, it could fail.  If you have your project open when trying to run the script, ensure that you remove it from the project, then save the project to remove any potential locks


... sort of retired...
0 Kudos
haslam33
New Contributor

Thanks, Dan. I think I figured it out. I ended up creating a model that used that MinimumBoundingGeometry geoprocessing tool in ModelBuilder within ArcGIS Pro. I then had the Python script call the model directly. That seemed to do the trick!

0 Kudos