Let's say that I have 4 features classe:
I want to erase my
LayerX with all the
So for example the erase feature for the
Layer3 will be
I'm using the function
Erase_analysis (in_features, erase_features, out_feature_class)
I don't want to create tousand of new layers, so during my iteration I try to use the same input name and output name.
My code using arcpy:
arcpy.env.overwriteOutput = True for x in n: for y in n[:(x-1)]: arcpy.Erase_analysis('layer'+str(x), 'layer'+str(y), 'layer'+str(x))
But, and it was expected, the python consol give me this error
Output Feature Class is same as Input Features, Failed to execute (Erase).
Is there a solution using arcpy ?
Is there a more pythonic way to solve this problem ?