<?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: Help: Using a Parameter variable from Python in Model Builder? in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/help-using-a-parameter-variable-from-python-in/m-p/793914#M1511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I don't use modelbuilder much only because I prefer to use Python...but I guess modelbuilder is getting stronger so maybe I'll change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looks like you've made a script tool, so you can use ImportToolbox to call your custom toolbox your tool resides in....that would be within another script.&amp;nbsp; It's really just a way to 'connect' scripts you've made into tools, built in 'modular fashion', that otherwise you'd write as one 'main' script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Neat thing about building models is you're leveraging the 'modularity' so to speak so that you can 'mix' python tools and system tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't done this in awhile but I think you'd use one of the set parameter methods to make a variable available for the next connected tool in the modelbuilder environment.&amp;nbsp; Probably I'm oversimplifying, but think of it this way:&amp;nbsp; the GetParam methods pass param vars in; the SetParam methods pass param vars out....or 'onward' to the next tool in-process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SetParameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resource Center » Professional Library » Geoprocessing » The ArcPy site package » Functions » Getting and setting parameters&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/SetParameter/000v00000018000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/SetParameter/000v00000018000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In fact, see the whole section in the help tree pertaining to 'Getting and Setting Parameters' -- there's some in there I have no idea about -- for example CopyParameter copies input to output (by index).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...actually, see the excellent illustration included at this link:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://gis.stackexchange.com/questions/34872/why-are-results-from-python-tool-not-in-results-window"&gt;http://gis.stackexchange.com/questions/34872/why-are-results-from-python-tool-not-in-results-window&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jul 2013 00:50:40 GMT</pubDate>
    <dc:creator>T__WayneWhitley</dc:creator>
    <dc:date>2013-07-23T00:50:40Z</dc:date>
    <item>
      <title>Help: Using a Parameter variable from Python in Model Builder?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/help-using-a-parameter-variable-from-python-in/m-p/793913#M1510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using ArcMap 10 SP5 and wanting to use a couple of parameter varaibles from Python in Model Builder.&amp;nbsp; In Python they are set up as below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OutputDatabase = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ImportTableDatasetVar = arcpy.GetParameterAsText(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Script Properties are shown in attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These 2 are set as input, but I have added to output for the model builder custom tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have imported the toolbox as below: (Variables are set in Modelbuilder as standalone workspace variables that are then used by the table to table tool)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AddingTBL = arcpy.ImportToolbox("C:/...../Toolboxname.tbx")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AddingTBL.AddingTables(OutputDatabase, ImportTableDatasetVar)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brian Donaldson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 18:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/help-using-a-parameter-variable-from-python-in/m-p/793913#M1510</guid>
      <dc:creator>BrianDonaldson</dc:creator>
      <dc:date>2013-07-22T18:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Using a Parameter variable from Python in Model Builder?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/help-using-a-parameter-variable-from-python-in/m-p/793914#M1511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I don't use modelbuilder much only because I prefer to use Python...but I guess modelbuilder is getting stronger so maybe I'll change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looks like you've made a script tool, so you can use ImportToolbox to call your custom toolbox your tool resides in....that would be within another script.&amp;nbsp; It's really just a way to 'connect' scripts you've made into tools, built in 'modular fashion', that otherwise you'd write as one 'main' script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Neat thing about building models is you're leveraging the 'modularity' so to speak so that you can 'mix' python tools and system tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't done this in awhile but I think you'd use one of the set parameter methods to make a variable available for the next connected tool in the modelbuilder environment.&amp;nbsp; Probably I'm oversimplifying, but think of it this way:&amp;nbsp; the GetParam methods pass param vars in; the SetParam methods pass param vars out....or 'onward' to the next tool in-process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SetParameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resource Center » Professional Library » Geoprocessing » The ArcPy site package » Functions » Getting and setting parameters&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/SetParameter/000v00000018000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/SetParameter/000v00000018000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In fact, see the whole section in the help tree pertaining to 'Getting and Setting Parameters' -- there's some in there I have no idea about -- for example CopyParameter copies input to output (by index).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...actually, see the excellent illustration included at this link:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://gis.stackexchange.com/questions/34872/why-are-results-from-python-tool-not-in-results-window"&gt;http://gis.stackexchange.com/questions/34872/why-are-results-from-python-tool-not-in-results-window&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 00:50:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/help-using-a-parameter-variable-from-python-in/m-p/793914#M1511</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-07-23T00:50:40Z</dc:date>
    </item>
  </channel>
</rss>

