<?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 Run a python script in a ModelBuilder in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/run-a-python-script-in-a-modelbuilder/m-p/351716#M27564</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a script in python Fill a raster tool, the code is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy,os,glob,sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CheckOutExtension("spatial")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput=True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;path&lt;/STRONG&gt;&lt;SPAN&gt;=sys.argv[1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;raster=sys.argv[2]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DEM = raster&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Fill&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.gp.Fill_sa(DEM, &lt;/SPAN&gt;&lt;STRONG&gt;path&lt;/STRONG&gt;&lt;SPAN&gt;+"\\DEM_Fill", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using two parameters: script of the toolbox in ArcMap, and the other in ModelBuilder add the script with parameters of the &lt;/SPAN&gt;&lt;STRONG&gt;path&lt;/STRONG&gt;&lt;SPAN&gt; (workspace) and raster (Raster Dataset), run and displays the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000860: Input surface raster: is not the type of Composite Geodataset, or does not exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Fill).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have ArcGIS 10.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Sep 2011 18:52:31 GMT</pubDate>
    <dc:creator>FranzLeonardo</dc:creator>
    <dc:date>2011-09-27T18:52:31Z</dc:date>
    <item>
      <title>Run a python script in a ModelBuilder</title>
      <link>https://community.esri.com/t5/python-questions/run-a-python-script-in-a-modelbuilder/m-p/351716#M27564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a script in python Fill a raster tool, the code is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy,os,glob,sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CheckOutExtension("spatial")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput=True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;path&lt;/STRONG&gt;&lt;SPAN&gt;=sys.argv[1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;raster=sys.argv[2]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DEM = raster&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Fill&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.gp.Fill_sa(DEM, &lt;/SPAN&gt;&lt;STRONG&gt;path&lt;/STRONG&gt;&lt;SPAN&gt;+"\\DEM_Fill", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using two parameters: script of the toolbox in ArcMap, and the other in ModelBuilder add the script with parameters of the &lt;/SPAN&gt;&lt;STRONG&gt;path&lt;/STRONG&gt;&lt;SPAN&gt; (workspace) and raster (Raster Dataset), run and displays the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000860: Input surface raster: is not the type of Composite Geodataset, or does not exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Fill).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have ArcGIS 10.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2011 18:52:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-a-python-script-in-a-modelbuilder/m-p/351716#M27564</guid>
      <dc:creator>FranzLeonardo</dc:creator>
      <dc:date>2011-09-27T18:52:31Z</dc:date>
    </item>
  </channel>
</rss>

