<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic script error in 10.1 but not in 10.0 (python script running from custom toolbox) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/script-error-in-10-1-but-not-in-10-0-python-script/m-p/283421#M21891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote a script which works in 10.0 (which I run on my computer) but doesn't work on my collaborators machine which runs ArcGIS 10.1.&amp;nbsp; I don't have access to a version of 10.1 so it is hard to trouble shoot but I was wondering if anyone has run into this problem before (and tell me how they fixed it) or could just spot the problem in the code below.&amp;nbsp; The script is part of a toolbox I sent him.&amp;nbsp; He had to manually point to where the script was stored under script &amp;gt; properties &amp;gt; source tab and he gets the following error: " 000714 : Error in script &amp;lt;value&amp;gt;. " &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone see off the top of their head what the problem is? It's just very weird that the script works in 10.0 but not in 10.1.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also can anyone give me pointers on how to get this script to run faster?&amp;nbsp; This second question is unrelated to the first but I figured I ask since I was already here and its something that has been bugging me.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you in advance for your time,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amelie&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;############ IMPORTANT ######################## # Assumes that your land cover layer is projected in meters # Uses NLCD 2006 classification codes # output file must be a shapefile and the output name must have .shp at the end of it. # The Zone_value (parameter 3) must match what you reclass as one in parameter 4 ##############################################&amp;nbsp; # Set the necessary product code # import arcinfo&amp;nbsp;&amp;nbsp; # Import arcpy module import arcpy from arcpy import env&amp;nbsp; # Check out any necessary licenses arcpy.CheckOutExtension("spatial")&amp;nbsp; ###################### Script arguments&amp;nbsp; Input_Fishnet_with_unique_ID2_field = arcpy.GetParameterAsText(0) #Input_Fishnet_with_unique_ID2_field = "D:\\DATA\\USA\\MigBirdFishnet\\NLCDfishnet20mi_p.shp" # provide a default value if unspecified&amp;nbsp; Input_Land_Cover__NLCD_2006_ = arcpy.GetParameterAsText(1) #Input_Land_Cover__NLCD_2006_ = "D:\\DATA\\NLCD\\nlcd2006_cook" # provide a default value if unspecified&amp;nbsp; Output_Workspace = arcpy.GetParameterAsText(2) #Output_Workspace = "D:\\DATA\\DELETE" # provide a default value if unspecified&amp;nbsp; # Set environment settings env.workspace = Output_Workspace env.mask = Input_Land_Cover__NLCD_2006_&amp;nbsp; Zone_value_you_want_to_shrink__LC_code_ = arcpy.GetParameterAsText(3) #Zone_value_you_want_to_shrink__LC_code_ = "11" # provide a default value if unspecified&amp;nbsp; Land_Cover_Code_for_which_you_want_to_extract_distance_measure = arcpy.GetParameterAsText(4) #Land_Cover_Code_for_which_you_want_to_extract_distance_measure = "95" # provide a default value if unspecified&amp;nbsp; Final_Output_shp = Output_Workspace + "\\" + arcpy.GetParameterAsText(5)&amp;nbsp;&amp;nbsp; #################### # could try this: tmp3 = Reclassify(Int(EucDistance(inR, "", "1000", "")), "VALUE", "0 NODATA", "DATA")&amp;nbsp; #Get the minimum value in the land cover raster MinResult = arcpy.GetRasterProperties_management(Input_Land_Cover__NLCD_2006_, "MINIMUM") #Get the elevation standard deviation value from geoprocessing result object min_r = MinResult.getOutput(0) #arcpy.AddMessage("minimum value of land cover raster is " + str(min_r))&amp;nbsp; #Get the maximum value in the land cover raster MaxResult = arcpy.GetRasterProperties_management(Input_Land_Cover__NLCD_2006_, "MAXIMUM") #Get the elevation standard deviation value from geoprocessing result object max_r = MaxResult.getOutput(0) #arcpy.AddMessage("maximum value of land cover raster is " + str(max_r))&amp;nbsp; # Process: Reclassify, i.e. extract wetland=95 from NLCD value = int(Land_Cover_Code_for_which_you_want_to_extract_distance_measure) if value == int(min_r):&amp;nbsp; remapList1 = [value,value,1]&amp;nbsp; remapList2 = [value+1,max_r,"NODATA"]&amp;nbsp; complete = [remapList1,remapList2]&amp;nbsp;&amp;nbsp; elif value == int(max_r):&amp;nbsp; remapList1 = [min_r,value-1,"NODATA"]&amp;nbsp; remapList2 = [value,value,1]&amp;nbsp; complete = [remapList1,remapList2]&amp;nbsp; elif value &amp;gt;= int(min_r) and value &amp;lt;= int(max_r):&amp;nbsp; remapList1 = [min_r,value-1,"NODATA"]&amp;nbsp; remapList2 = [value,value,1]&amp;nbsp; remapList3 = [value+1,max_r,"NODATA"]&amp;nbsp; complete = [remapList1,remapList2,remapList3] else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("need to pick a value within range of " + str(min_r) +" to "+ str(max_r))&amp;nbsp; remap = arcpy.sa.RemapRange(complete)&amp;nbsp; nlcd_ag = arcpy.sa.Reclassify(Input_Land_Cover__NLCD_2006_, "VALUE", remap, "NODATA") out_rc1 = Output_Workspace + "\\out1" nlcd_ag.save(out_rc1)&amp;nbsp; del value del complete&amp;nbsp; # Process: Reclassify again, i.e. extract water=11 from NLCD&amp;nbsp; (to build shoreline) value = int(Zone_value_you_want_to_shrink__LC_code_) if value == int(min_r):&amp;nbsp; remapList1 = [value,value,1]&amp;nbsp; remapList2 = [value+1,max_r,0]&amp;nbsp; complete = [remapList1,remapList2]&amp;nbsp;&amp;nbsp; elif value == int(max_r):&amp;nbsp; remapList1 = [min_r,value-1,0]&amp;nbsp; remapList2 = [value,value,1]&amp;nbsp; complete = [remapList1,remapList2]&amp;nbsp; elif value &amp;gt;= int(min_r) and value &amp;lt;= int(max_r):&amp;nbsp; remapList1 = [min_r,value-1,0]&amp;nbsp; remapList2 = [value,value,1]&amp;nbsp; remapList3 = [value+1,max_r,0]&amp;nbsp; complete = [remapList1,remapList2,remapList3] else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("need to pick a value within range of " + str(min_r) +" to "+ str(max_r))&amp;nbsp; remap5 = arcpy.sa.RemapRange(complete)&amp;nbsp; nlcd_line = arcpy.sa.Reclassify(Input_Land_Cover__NLCD_2006_, "VALUE", remap5, "DATA") out_rc5 = Output_Workspace + "\\out5" nlcd_line.save(out_rc5)&amp;nbsp; # Process: Shrink zoneSet = [int(Zone_value_you_want_to_shrink__LC_code_)] out_shrink = arcpy.sa.Shrink(Input_Land_Cover__NLCD_2006_, 1, zoneSet) out_shrink_s = Output_Workspace + "\\shrink1" out_shrink.save(out_shrink_s)&amp;nbsp; # Process: Reclassify (2) nlcd_water = arcpy.sa.Reclassify(out_shrink, "VALUE", remap5, "DATA") out_rc2 = Output_Workspace + "\\out2" nlcd_water.save(out_rc2)&amp;nbsp; # Process: Plus out_plus_for = arcpy.sa.Plus(nlcd_line, nlcd_water) out_plus = Output_Workspace + "\\temp1" out_plus_for.save(out_plus)&amp;nbsp; # Process: Reclassify (3) remap3 = arcpy.sa.RemapRange([[0,0,"NODATA"],[1,1,1],[2,2,"NODATA"]]) nlcd_for = arcpy.sa.Reclassify(out_plus_for, "VALUE", remap3, "DATA") out_rc3 = Output_Workspace + "\\out3" nlcd_for.save(out_rc3)&amp;nbsp; # Process: Reclassify (4) remap4 = arcpy.sa.RemapRange([[0,0,0],[1,1,1000],[2,2,0]]) nlcd_new_pre = arcpy.sa.Reclassify(out_plus_for, "VALUE", remap4, "DATA") out_rc4 = Output_Workspace + "\\out4" nlcd_new_pre.save(out_rc4) arcpy.AddMessage("finished reclassifying")&amp;nbsp; # Process: Plus # save output permanently out_plus2 = arcpy.sa.Plus(nlcd_new_pre,Input_Land_Cover__NLCD_2006_) out_rc6 = Output_Workspace + "\\new_nlcd" out_plus2.save(out_rc6) arcpy.AddMessage("created new nlcd layer")&amp;nbsp; # Process: Euclidean Distance # Probably should make cell_sz_in_raster a model parameter cell_sz_in_raster = 30 out_euc = arcpy.sa.EucDistance(nlcd_for, "", cell_sz_in_raster, "") out_euc_s = Output_Workspace + "\\euc_dist1" out_euc.save(out_euc_s) arcpy.AddMessage("finished calculating euclidian distance")&amp;nbsp; # Process: Times out_times = arcpy.sa.Times(out_euc, nlcd_ag) out_temp2 = Output_Workspace + "\\temp2" out_times.save(out_temp2)&amp;nbsp; # Process: Int # save output permanently&amp;nbsp; out_Int = arcpy.sa.Int(out_times) out_Int_s = Output_Workspace + "\\ag_dist" out_Int.save(out_Int_s)&amp;nbsp; # Process: Copy initial fishnet shapefile so that original is not modified arcpy.Copy_management(Input_Fishnet_with_unique_ID2_field, Final_Output_shp, "")&amp;nbsp; # Process: Add field to initial fishnet shapefile arcpy.AddField_management(Final_Output_shp, "XX_ID_XX", "SHORT", 6, "", "","refcode", "NULLABLE") #arcpy.AddField_management(Final_Output_shp,"XX_ID_XX","SHORT","6","#","#","#","NULLABLE","NON_REQUIRED","#")&amp;nbsp; # Process: Calculate Field #arcpy.CalculateField_management(Final_Output_shp, "XX_ID_XX", "[FID]","VB","X") arcpy.CalculateField_management(Final_Output_shp, "XX_ID_XX", "!FID!","PYTHON_9.3","")&amp;nbsp; # Process: Zonal Statistics as Table outTable = Output_Workspace + "\\ag_dist_per_cell.dbf" outZSaT = arcpy.sa.ZonalStatisticsAsTable(Final_Output_shp, "XX_ID_XX", out_Int_s, outTable, "DATA", "ALL") arcpy.AddMessage("finished calculating mean +/- std distance per cell")&amp;nbsp; # Process: Tabulate Area (2) outTable_T = Output_Workspace + "\\new_nlcd_per_cell.dbf" arcpy.sa.TabulateArea(Final_Output_shp, "XX_ID_XX", out_plus2, "VALUE", outTable_T,"30") arcpy.AddMessage("finished calculating area of each LC class in each cell")&amp;nbsp; # Process: Join Field fieldList = ["MEAN", "STD"] arcpy.JoinField_management(Final_Output_shp, "XX_ID_XX", outTable, "XX_ID_XX",fieldList)&amp;nbsp; # Process: Join Field (2) arcpy.JoinField_management(Final_Output_shp, "XX_ID_XX", outTable_T, "XX_ID_XX","")&amp;nbsp;&amp;nbsp; # Delete intermediary files ##arcpy.Delete_management(out_rc1, "") ##arcpy.Delete_management(out_rc5, "") ##arcpy.Delete_management(out_shrink_s, "") ##arcpy.Delete_management(out_rc2, "") ##arcpy.Delete_management(out_plus, "") ##arcpy.Delete_management(out_rc3, "") ##arcpy.Delete_management(out_rc4, "") ##arcpy.Delete_management(out_euc_s, "") ##arcpy.Delete_management(out_temp2, "")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Dec 2012 00:41:31 GMT</pubDate>
    <dc:creator>AmelieDavis</dc:creator>
    <dc:date>2012-12-14T00:41:31Z</dc:date>
    <item>
      <title>script error in 10.1 but not in 10.0 (python script running from custom toolbox)</title>
      <link>https://community.esri.com/t5/python-questions/script-error-in-10-1-but-not-in-10-0-python-script/m-p/283421#M21891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote a script which works in 10.0 (which I run on my computer) but doesn't work on my collaborators machine which runs ArcGIS 10.1.&amp;nbsp; I don't have access to a version of 10.1 so it is hard to trouble shoot but I was wondering if anyone has run into this problem before (and tell me how they fixed it) or could just spot the problem in the code below.&amp;nbsp; The script is part of a toolbox I sent him.&amp;nbsp; He had to manually point to where the script was stored under script &amp;gt; properties &amp;gt; source tab and he gets the following error: " 000714 : Error in script &amp;lt;value&amp;gt;. " &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone see off the top of their head what the problem is? It's just very weird that the script works in 10.0 but not in 10.1.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also can anyone give me pointers on how to get this script to run faster?&amp;nbsp; This second question is unrelated to the first but I figured I ask since I was already here and its something that has been bugging me.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you in advance for your time,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amelie&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;############ IMPORTANT ######################## # Assumes that your land cover layer is projected in meters # Uses NLCD 2006 classification codes # output file must be a shapefile and the output name must have .shp at the end of it. # The Zone_value (parameter 3) must match what you reclass as one in parameter 4 ##############################################&amp;nbsp; # Set the necessary product code # import arcinfo&amp;nbsp;&amp;nbsp; # Import arcpy module import arcpy from arcpy import env&amp;nbsp; # Check out any necessary licenses arcpy.CheckOutExtension("spatial")&amp;nbsp; ###################### Script arguments&amp;nbsp; Input_Fishnet_with_unique_ID2_field = arcpy.GetParameterAsText(0) #Input_Fishnet_with_unique_ID2_field = "D:\\DATA\\USA\\MigBirdFishnet\\NLCDfishnet20mi_p.shp" # provide a default value if unspecified&amp;nbsp; Input_Land_Cover__NLCD_2006_ = arcpy.GetParameterAsText(1) #Input_Land_Cover__NLCD_2006_ = "D:\\DATA\\NLCD\\nlcd2006_cook" # provide a default value if unspecified&amp;nbsp; Output_Workspace = arcpy.GetParameterAsText(2) #Output_Workspace = "D:\\DATA\\DELETE" # provide a default value if unspecified&amp;nbsp; # Set environment settings env.workspace = Output_Workspace env.mask = Input_Land_Cover__NLCD_2006_&amp;nbsp; Zone_value_you_want_to_shrink__LC_code_ = arcpy.GetParameterAsText(3) #Zone_value_you_want_to_shrink__LC_code_ = "11" # provide a default value if unspecified&amp;nbsp; Land_Cover_Code_for_which_you_want_to_extract_distance_measure = arcpy.GetParameterAsText(4) #Land_Cover_Code_for_which_you_want_to_extract_distance_measure = "95" # provide a default value if unspecified&amp;nbsp; Final_Output_shp = Output_Workspace + "\\" + arcpy.GetParameterAsText(5)&amp;nbsp;&amp;nbsp; #################### # could try this: tmp3 = Reclassify(Int(EucDistance(inR, "", "1000", "")), "VALUE", "0 NODATA", "DATA")&amp;nbsp; #Get the minimum value in the land cover raster MinResult = arcpy.GetRasterProperties_management(Input_Land_Cover__NLCD_2006_, "MINIMUM") #Get the elevation standard deviation value from geoprocessing result object min_r = MinResult.getOutput(0) #arcpy.AddMessage("minimum value of land cover raster is " + str(min_r))&amp;nbsp; #Get the maximum value in the land cover raster MaxResult = arcpy.GetRasterProperties_management(Input_Land_Cover__NLCD_2006_, "MAXIMUM") #Get the elevation standard deviation value from geoprocessing result object max_r = MaxResult.getOutput(0) #arcpy.AddMessage("maximum value of land cover raster is " + str(max_r))&amp;nbsp; # Process: Reclassify, i.e. extract wetland=95 from NLCD value = int(Land_Cover_Code_for_which_you_want_to_extract_distance_measure) if value == int(min_r):&amp;nbsp; remapList1 = [value,value,1]&amp;nbsp; remapList2 = [value+1,max_r,"NODATA"]&amp;nbsp; complete = [remapList1,remapList2]&amp;nbsp;&amp;nbsp; elif value == int(max_r):&amp;nbsp; remapList1 = [min_r,value-1,"NODATA"]&amp;nbsp; remapList2 = [value,value,1]&amp;nbsp; complete = [remapList1,remapList2]&amp;nbsp; elif value &amp;gt;= int(min_r) and value &amp;lt;= int(max_r):&amp;nbsp; remapList1 = [min_r,value-1,"NODATA"]&amp;nbsp; remapList2 = [value,value,1]&amp;nbsp; remapList3 = [value+1,max_r,"NODATA"]&amp;nbsp; complete = [remapList1,remapList2,remapList3] else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("need to pick a value within range of " + str(min_r) +" to "+ str(max_r))&amp;nbsp; remap = arcpy.sa.RemapRange(complete)&amp;nbsp; nlcd_ag = arcpy.sa.Reclassify(Input_Land_Cover__NLCD_2006_, "VALUE", remap, "NODATA") out_rc1 = Output_Workspace + "\\out1" nlcd_ag.save(out_rc1)&amp;nbsp; del value del complete&amp;nbsp; # Process: Reclassify again, i.e. extract water=11 from NLCD&amp;nbsp; (to build shoreline) value = int(Zone_value_you_want_to_shrink__LC_code_) if value == int(min_r):&amp;nbsp; remapList1 = [value,value,1]&amp;nbsp; remapList2 = [value+1,max_r,0]&amp;nbsp; complete = [remapList1,remapList2]&amp;nbsp;&amp;nbsp; elif value == int(max_r):&amp;nbsp; remapList1 = [min_r,value-1,0]&amp;nbsp; remapList2 = [value,value,1]&amp;nbsp; complete = [remapList1,remapList2]&amp;nbsp; elif value &amp;gt;= int(min_r) and value &amp;lt;= int(max_r):&amp;nbsp; remapList1 = [min_r,value-1,0]&amp;nbsp; remapList2 = [value,value,1]&amp;nbsp; remapList3 = [value+1,max_r,0]&amp;nbsp; complete = [remapList1,remapList2,remapList3] else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("need to pick a value within range of " + str(min_r) +" to "+ str(max_r))&amp;nbsp; remap5 = arcpy.sa.RemapRange(complete)&amp;nbsp; nlcd_line = arcpy.sa.Reclassify(Input_Land_Cover__NLCD_2006_, "VALUE", remap5, "DATA") out_rc5 = Output_Workspace + "\\out5" nlcd_line.save(out_rc5)&amp;nbsp; # Process: Shrink zoneSet = [int(Zone_value_you_want_to_shrink__LC_code_)] out_shrink = arcpy.sa.Shrink(Input_Land_Cover__NLCD_2006_, 1, zoneSet) out_shrink_s = Output_Workspace + "\\shrink1" out_shrink.save(out_shrink_s)&amp;nbsp; # Process: Reclassify (2) nlcd_water = arcpy.sa.Reclassify(out_shrink, "VALUE", remap5, "DATA") out_rc2 = Output_Workspace + "\\out2" nlcd_water.save(out_rc2)&amp;nbsp; # Process: Plus out_plus_for = arcpy.sa.Plus(nlcd_line, nlcd_water) out_plus = Output_Workspace + "\\temp1" out_plus_for.save(out_plus)&amp;nbsp; # Process: Reclassify (3) remap3 = arcpy.sa.RemapRange([[0,0,"NODATA"],[1,1,1],[2,2,"NODATA"]]) nlcd_for = arcpy.sa.Reclassify(out_plus_for, "VALUE", remap3, "DATA") out_rc3 = Output_Workspace + "\\out3" nlcd_for.save(out_rc3)&amp;nbsp; # Process: Reclassify (4) remap4 = arcpy.sa.RemapRange([[0,0,0],[1,1,1000],[2,2,0]]) nlcd_new_pre = arcpy.sa.Reclassify(out_plus_for, "VALUE", remap4, "DATA") out_rc4 = Output_Workspace + "\\out4" nlcd_new_pre.save(out_rc4) arcpy.AddMessage("finished reclassifying")&amp;nbsp; # Process: Plus # save output permanently out_plus2 = arcpy.sa.Plus(nlcd_new_pre,Input_Land_Cover__NLCD_2006_) out_rc6 = Output_Workspace + "\\new_nlcd" out_plus2.save(out_rc6) arcpy.AddMessage("created new nlcd layer")&amp;nbsp; # Process: Euclidean Distance # Probably should make cell_sz_in_raster a model parameter cell_sz_in_raster = 30 out_euc = arcpy.sa.EucDistance(nlcd_for, "", cell_sz_in_raster, "") out_euc_s = Output_Workspace + "\\euc_dist1" out_euc.save(out_euc_s) arcpy.AddMessage("finished calculating euclidian distance")&amp;nbsp; # Process: Times out_times = arcpy.sa.Times(out_euc, nlcd_ag) out_temp2 = Output_Workspace + "\\temp2" out_times.save(out_temp2)&amp;nbsp; # Process: Int # save output permanently&amp;nbsp; out_Int = arcpy.sa.Int(out_times) out_Int_s = Output_Workspace + "\\ag_dist" out_Int.save(out_Int_s)&amp;nbsp; # Process: Copy initial fishnet shapefile so that original is not modified arcpy.Copy_management(Input_Fishnet_with_unique_ID2_field, Final_Output_shp, "")&amp;nbsp; # Process: Add field to initial fishnet shapefile arcpy.AddField_management(Final_Output_shp, "XX_ID_XX", "SHORT", 6, "", "","refcode", "NULLABLE") #arcpy.AddField_management(Final_Output_shp,"XX_ID_XX","SHORT","6","#","#","#","NULLABLE","NON_REQUIRED","#")&amp;nbsp; # Process: Calculate Field #arcpy.CalculateField_management(Final_Output_shp, "XX_ID_XX", "[FID]","VB","X") arcpy.CalculateField_management(Final_Output_shp, "XX_ID_XX", "!FID!","PYTHON_9.3","")&amp;nbsp; # Process: Zonal Statistics as Table outTable = Output_Workspace + "\\ag_dist_per_cell.dbf" outZSaT = arcpy.sa.ZonalStatisticsAsTable(Final_Output_shp, "XX_ID_XX", out_Int_s, outTable, "DATA", "ALL") arcpy.AddMessage("finished calculating mean +/- std distance per cell")&amp;nbsp; # Process: Tabulate Area (2) outTable_T = Output_Workspace + "\\new_nlcd_per_cell.dbf" arcpy.sa.TabulateArea(Final_Output_shp, "XX_ID_XX", out_plus2, "VALUE", outTable_T,"30") arcpy.AddMessage("finished calculating area of each LC class in each cell")&amp;nbsp; # Process: Join Field fieldList = ["MEAN", "STD"] arcpy.JoinField_management(Final_Output_shp, "XX_ID_XX", outTable, "XX_ID_XX",fieldList)&amp;nbsp; # Process: Join Field (2) arcpy.JoinField_management(Final_Output_shp, "XX_ID_XX", outTable_T, "XX_ID_XX","")&amp;nbsp;&amp;nbsp; # Delete intermediary files ##arcpy.Delete_management(out_rc1, "") ##arcpy.Delete_management(out_rc5, "") ##arcpy.Delete_management(out_shrink_s, "") ##arcpy.Delete_management(out_rc2, "") ##arcpy.Delete_management(out_plus, "") ##arcpy.Delete_management(out_rc3, "") ##arcpy.Delete_management(out_rc4, "") ##arcpy.Delete_management(out_euc_s, "") ##arcpy.Delete_management(out_temp2, "")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 00:41:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-error-in-10-1-but-not-in-10-0-python-script/m-p/283421#M21891</guid>
      <dc:creator>AmelieDavis</dc:creator>
      <dc:date>2012-12-14T00:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: script error in 10.1 but not in 10.0 (python script running from custom toolbox)</title>
      <link>https://community.esri.com/t5/python-questions/script-error-in-10-1-but-not-in-10-0-python-script/m-p/283422#M21892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Amelie,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to get the script to work in 10.1.&amp;nbsp; A couple things to note are the way the parameters are set up for the script.&amp;nbsp; For GetParameterAsText(0), make sure this is set to a data type of Feature Class or Shapefile.&amp;nbsp; If this is set to 'Feature Layer' and the user click's the drop down to choose a layer within the MXD, the Copy_management function will fail.&amp;nbsp; Also, be sure that you are copying to the same data type.&amp;nbsp; If GetParameterAsText(0) is a shapefile, you will need to copy to a shapefile.&amp;nbsp; You cannot copy to different workspace types (i.e. shapefile to feature class).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For GetParameterAsText(5), if this is set to a data type of Feature Class or Shapefile within the script's Parameter tab you will need to update the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Final_Output_shp = Output_Workspace + "\\" + arcpy.GetParameterAsText(5)&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Final_Output_shp = arcpy.GetParameterAsText(5)&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 10:41:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-error-in-10-1-but-not-in-10-0-python-script/m-p/283422#M21892</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-12-14T10:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: script error in 10.1 but not in 10.0 (python script running from custom toolbox)</title>
      <link>https://community.esri.com/t5/python-questions/script-error-in-10-1-but-not-in-10-0-python-script/m-p/283423#M21893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you!! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions on how to make it run faster by any chance?&amp;nbsp; I can definitely comment out the out.save throughout - I was just keeping them while testing the model but can't think of anything else...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In any case it now works in ArcGIS 10.1 so big thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 16:36:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-error-in-10-1-but-not-in-10-0-python-script/m-p/283423#M21893</guid>
      <dc:creator>AmelieDavis</dc:creator>
      <dc:date>2012-12-14T16:36:29Z</dc:date>
    </item>
  </channel>
</rss>

