# Import arcpy module import arcpy from arcpy import env env.workspace = "C:\\avdata\\FallChinookRedds\\2013\\Shapefiles\\" # Local variables: inshape = "MDhighway972211113.shp" fname = "\""+inshape+"\"" surdate = "\"11/01/2013\"" streamname = "\"Yakima River\"" specname = "\"Fall Chinook\"" # Process: Delete Field arcpy.DeleteField_management(inshape, "TYPE;Y_PROJ;X_PROJ;DISPLAY;SYMBOL;UNUSED1;DIST;PROX_INDEX;COLOR;DEPTH;TEMP;TIME;WPT_CLASS;SUB_CLASS;ATTRIB;LINK;STATE;COUNTRY;CITY;ADDRESS;FACILITY;CROSSROAD;UNUSED2;ETE;DTYPE;MODEL") #more steps ......
# Import arcpy module import arcpy from arcpy import env env.workspace = "C:\\avdata\\FallChinookRedds\\" # Local variables: inshape = "2zillTOgra102312.shp" fname = "\""+inshape+"\"" surdate = "\"10/23/2012\"" streamname = "\"Yakima River\"" specname = "\"Fall Chinook\"" # Process: Delete Field arcpy.DeleteField_management(inshape, "TYPE;Y_PROJ;X_PROJ;DISPLAY;SYMBOL;UNUSED1;DIST;PROX_INDEX;COLOR;DEPTH;TEMP;TIME;WPT_CLASS;SUB_CLASS;ATTRIB;LINK;STATE;COUNTRY;CITY;ADDRESS;FACILITY;CROSSROAD;UNUSED2;ETE;DTYPE;MODEL") #more steps .....
Solved! Go to Solution.
arcpy.RefreshCatalog(env.workspace)
Since you are playing the dangerous game of working parallel with two apps in the same workspace, I'm thinking you may want to try this method to have arcpy verify what's REALLY there in the workspace, just not last time it checked:arcpy.RefreshCatalog(env.workspace)
# Import arcpy module import arcpy from arcpy import env env.workspace = "C:\\avdata\\FallChinookRedds\\2013\\Shapefiles\\" # Local variables: inshape = "MDhighway972211113.shp" fname = "\""+inshape+"\"" surdate = "\"11/01/2013\"" streamname = "\"Yakima River\"" specname = "\"Fall Chinook\"" # Process: Delete Field arcpy.DeleteField_management(inshape, "TYPE;Y_PROJ;X_PROJ;DISPLAY;SYMBOL;UNUSED1;DIST;PROX_INDEX;COLOR;DEPTH;TEMP;TIME;WPT_CLASS;SUB_CLASS;ATTRIB;LINK;STATE;COUNTRY;CITY;ADDRESS;FACILITY;CROSSROAD;UNUSED2;ETE;DTYPE;MODEL") # Process: Add Field #arcpy.AddField_management(inshape, "COMMENT", "TEXT", "", "", "50", "", "NON_NULLABLE", "NON_REQUIRED", "") #arcpy.AddField_management(inshape, "ALTITUDE", "DOUBLE", "", "", "8", "", "NON_NULLABLE", "NON_REQUIRED", "") #arcpy.AddField_management(inshape, "FILENAME", "TEXT", "", "", "254", "", "NON_NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(inshape, "SurveyDate", "DATE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(inshape, "SurveyYear", "LONG", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(inshape, "observer", "TEXT", "", "", "25", "", "NON_NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(inshape, "PassNum", "SHORT", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(inshape, "Species", "TEXT", "", "", "50", "", "NON_NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(inshape, "Stream", "TEXT", "", "", "50", "", "NON_NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(inshape, "ReddStatus", "TEXT", "", "", "3", "", "NON_NULLABLE", "NON_REQUIRED", "") # Process: Calculate Field arcpy.CalculateField_management(inshape, "SurveyDate", surdate, "VB", "") arcpy.CalculateField_management(inshape, "SurveyYear", "2013", "VB", "") arcpy.CalculateField_management(inshape, "Stream", streamname, "VB", "") #arcpy.CalculateField_management(inshape, "observer", "\"Brandon Rogers\"", "VB", "") #arcpy.CalculateField_management(inshape, "PassNum", "PASS", "VB", "") arcpy.CalculateField_management(inshape, "Species", specname, "VB", "") arcpy.CalculateField_management(inshape, "FILENAME", fname, "VB", "") arcpy.GetCount_management(inshape)