<?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 Re: New To Python Script use in ArcGis 10.  Topo to Raster Errors??? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495665#M38908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think you have just exported the scripting behind the tool, but you need to be add your inputs as it looks like it is using a bunch of placeholders and maybe you intentionally hardcoded a couple of layers (or maybe they were just exported that way). Are you just right clicking on it in the toolbox and hitting run? Your script needs to have some lines defining sys.argv() to variable names that are used through your script and when you import the script into the toolbox you need to define these variables in the parameters tab.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Feb 2011 21:06:07 GMT</pubDate>
    <dc:creator>MichaelStead</dc:creator>
    <dc:date>2011-02-19T21:06:07Z</dc:date>
    <item>
      <title>New To Python Script use in ArcGis 10.  Topo to Raster Errors???</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495664#M38907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm new to exporting a model to python script.&amp;nbsp; I'm trying to automate the generation of maps.&amp;nbsp; I have a toolbox with a tool in it called PrecipMap.&amp;nbsp; I need to be able to run that tool automatically.&amp;nbsp; I exported the script and tried to run.&amp;nbsp; I get this error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "R:\PrecipMap\PrecipMapping.py", line 44, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.TopoToRaster_sa("R:\\PrecipMap\\DailyPrecip.shp pcpn PointElevation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;", TopoToR_shp2, "0.003", "R:\\Shapefiles\\Other Shapefiles\\MEGCWA.shp", "20",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"", "", "ENFORCE", "CONTOUR", "40", "", "1", "0", "", "", Output_stream_polyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_features, Output_remaining_sink_point_features, Output_diagnostic_file, Output_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parameter_file)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; line 474, in &amp;lt;lambda&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: ERROR 000622: Failed to execute (Topo to Raster).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000628: Cannot set input into parameter extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it says the parameters are not set.&amp;nbsp; This all works just fine in Model Builder.&amp;nbsp; Can someone help me?&amp;nbsp; I have tried to set the parameters but I'm not really sure what I'm doing or what the parameters even are.&amp;nbsp; Everything in the topo to raster tool that is not "optional" is defined.&amp;nbsp; Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Feb 2011 17:48:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495664#M38907</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2011-02-19T17:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: New To Python Script use in ArcGis 10.  Topo to Raster Errors???</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495665#M38908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think you have just exported the scripting behind the tool, but you need to be add your inputs as it looks like it is using a bunch of placeholders and maybe you intentionally hardcoded a couple of layers (or maybe they were just exported that way). Are you just right clicking on it in the toolbox and hitting run? Your script needs to have some lines defining sys.argv() to variable names that are used through your script and when you import the script into the toolbox you need to define these variables in the parameters tab.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Feb 2011 21:06:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495665#M38908</guid>
      <dc:creator>MichaelStead</dc:creator>
      <dc:date>2011-02-19T21:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: New To Python Script use in ArcGis 10.  Topo to Raster Errors???</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495666#M38909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah I just use the run option in the toolbox to run the tool.&amp;nbsp; I take it that it's not that simple for the python script.&amp;nbsp; So do I have to add a script to the toolbox by right click on he toolbox and clicking add toolbox?&amp;nbsp; I tried that but I really don't know what I'm doing.&amp;nbsp; You have to add a python script, is that the script I just exported?&amp;nbsp; Also I'm unsure how to add the parameters and what the parameters even are.&amp;nbsp; Sorry for my ignorance but I just have never done this before and I'm just clueless.&amp;nbsp; Could you maybe describe how to do it?&amp;nbsp; I know how to auto export the maps once I get the model to run through python.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For reference here is what I do on a normal basis to run this model.&amp;nbsp; I just double click it to run it.&amp;nbsp; When finished I open my .mxd file and export the map.&amp;nbsp; All I did what open the model in modelbuilder and export the python script.&amp;nbsp; Would it help to see the script?&amp;nbsp; I can post if so.&amp;nbsp; Any help would be greatly appreciated.&amp;nbsp; Thank you so much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Feb 2011 00:30:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495666#M38909</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2011-02-20T00:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: New To Python Script use in ArcGis 10.  Topo to Raster Errors???</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495667#M38910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is the script that was exported in model builder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# ---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# sample.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Created on: 2011-02-19 11:28:49.00000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Description: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# ---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Import arcpy module&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Check out any necessary licenses&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CheckOutExtension("spatial")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Local variables:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MEG_counties_shp__2_ = "R:\\Shapefiles\\Other Shapefiles\\MEG_counties.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rr3precip_csv = "W:\\gistemp\\rr3precip.csv"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DailyPrecip_layer = "DailyPrecip_layer"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DailyPrecip_shp = "R:\\PrecipMap\\DailyPrecip.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TopoToR_shp2 = "R:\\ArcGIS\\Default.gdb\\TopoToR_shp2"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DailyPrecip_img = "R:\\PrecipMap\\DailyPrecip.img"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DailyPrecip100_img = "R:\\PrecipMap\\DailyPrecip100.img"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DailyPrec100 = "R:\\PrecipMap\\DailyPrec100"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DailyPrecipcontour_shp = "R:\\PrecipMap\\DailyPrecipcontour.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Output_stream_polyline_features = ""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Output_remaining_sink_point_features = ""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Output_diagnostic_file = ""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Output_parameter_file = ""&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Make XY Event Layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeXYEventLayer_management(rr3precip_csv, "lon", "lat", DailyPrecip_layer, "", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Make XY Event Layer Done'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Copy Features&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CopyFeatures_management(DailyPrecip_layer, DailyPrecip_shp, "", "0", "0", "0")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Copy Features Done'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Topo to Raster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.gp.TopoToRaster_sa("R:\\PrecipMap\\DailyPrecip.shp pcpn PointElevation", TopoToR_shp2, "0.003", "R:\\Shapefiles\\Other Shapefiles\\MEGCWA.shp", "20", "", "", "ENFORCE", "CONTOUR", "40", "", "1", "0", "", "", Output_stream_polyline_features, Output_remaining_sink_point_features, Output_diagnostic_file, Output_parameter_file)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Topo To Raster Done'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Clip&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Clip_management(TopoToR_shp2, "-91.407437 33.650117 -87.970738 36.630955", DailyPrecip_img, MEG_counties_shp__2_, "", "ClippingGeometry")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Clip Done'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Single Output Map Algebra&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.gp.SingleOutputMapAlgebra_sa("100 * [DailyPrecip.img] ", DailyPrecip100_img, "R:\\PrecipMap\\DailyPrecip.img")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Map Algebra Done'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Int&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.gp.Int_sa(DailyPrecip100_img, DailyPrec100)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Int Done'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Raster to Polygon&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.RasterToPolygon_conversion(DailyPrec100, DailyPrecipcontour_shp, "SIMPLIFY", "VALUE")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Raster To Polygon'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the "print" commands in there so I could track where the errors where happening.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Feb 2011 10:29:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495667#M38910</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2011-02-20T10:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: New To Python Script use in ArcGis 10.  Topo to Raster Errors???</title>
      <link>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495668#M38911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Its Fixed.&amp;nbsp; I Figured it out, finally.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Feb 2011 10:27:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/new-to-python-script-use-in-arcgis-10-nbsp-topo-to/m-p/495668#M38911</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2011-02-21T10:27:49Z</dc:date>
    </item>
  </channel>
</rss>

