Help with script!?

338
0
07-02-2014 11:52 AM
ChrisBrannin__GISP
New Contributor
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? Any help is greatly appreciated.

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, "-180.000417 -56.000417 180.000425 61.000419", r"M:/Elevation_Masks/test_space/Country_Masks_Test/Country_Masks_Test.gdb/" + filename + "_Clip", os.path.join(dirpath, filename), "NULL", "ClippingGeometry")
Tags (2)
0 Kudos
0 Replies