I have a simple script that gets all layers in a gdb and uses them to clip a DEM. What's happening though is it starts the clipping but never finishes and after killing the process I am unable to delete the file because of some lock on the file. Any thoughts/ideas on what's causing this or how to fix it? I tried the exact parameters within arcmap with no issues and zippy performance.
[EDIT Working code below]
for dirpath, dirnames, filenames in arcpy.da.Walk(clipLayers, datatype="FeatureClass", type="ALL"): for filename in filenames: if "ENG_NAME" in [f.name for f in arcpy.ListFields(os.path.join(dirpath, filename))]: print "Clipping: ", filename arcpy.env.overwriteOutput = True arcpy.Clip_management(dem, "#", r"M:/Masks_Test.gdb/" + filename + "_Clip", os.path.join(dirpath, filename), "0", "ClippingGeometry")