Hi All,A portion of my script goes into a geodatabase, deletes some features (ending in _old), and renames some features (adds _old to existing). It's part of a larger script that will replace, rename, and delete various feature classes in a file geodatabase. I get an unexpected result: one of my features has the same name as the container dataset. This results in the dataset being renamed instead of the feature. How can I avoid this? Does my script make sense?I have added some before and after shots to show what is happening.[ATTACH=CONFIG]12969[/ATTACH][ATTACH=CONFIG]12970[/ATTACH]fdss = arcpy.ListDatasets()
for fds in fdss:
print fds
if fds == "Streets":
fcs = arcpy.ListFeatureClasses("", "", "Streets")
for fc in fcs:
if fc == "streets_old":
print "Deleting old streets"
arcpy.Delete_management(fc, "Feature Class")
elif fc == "arterials_old":
print "Deleting old arterials"
arcpy.Delete_management(fc, "Feature Class")
elif fc == "streets":
arcpy.Rename_management(fc, fc + "_old", "Feature Class")
print "Renaming current streets to old"
elif fc == "arterials":
arcpy.Rename_management(fc, fc + "_old", "Feature Class")
print "Renaming current arterials to old"