Create feature class tool overwriting already existing feature classes irrespective of same name

1240
2
Jump to solution
02-13-2023 04:31 AM
Labels (1)
MSG_18
by
New Contributor

When a feature class is being created through ArcCatalog (Right click the gdb -> New feature class) and if the feature class name already exists, the process won't get finished. In fact, the "Finish" button will be in disabled state unless the name is changed. Example image as below

MSG_18_3-1676291155738.png

 

But if i use arcpy "arcpy.CreateFeatureclass_management" script, the already existing feature class - which has the same name as that of new one - is getting overwritten by the new one. I tried the same through "Create Feature Class (Data Management)" tool. Same result. Even though we get a warning - the process runs anyway and output feature class is being created irrespective of already existing name. Example screenshot below

MSG_18_0-1676291042982.png

I am running a script which will create feature classes in bulk. But since new feature classes are getting overwritten without error or warning, how to overcome this ?

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Every tool's environment tab allows you to set environments like whether to overwrite outputs or existing data.

see env—ArcGIS Pro | Documentation 

overwriteOutput  (Read and Write)

and set/get it in your scripts. or set it in a tool's Environments Tab


... sort of retired...

View solution in original post

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

Every tool's environment tab allows you to set environments like whether to overwrite outputs or existing data.

see env—ArcGIS Pro | Documentation 

overwriteOutput  (Read and Write)

and set/get it in your scripts. or set it in a tool's Environments Tab


... sort of retired...
0 Kudos
MSG_18
by
New Contributor

Thanks a lot Dan. I have changed the script accordingly and now it's running as expected

0 Kudos