<?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 arcpy.SetParameter - Multiple output parameters in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-multiple-output-parameters/m-p/107647#M8311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to set more than one output parameter using arcpy.setparameter&amp;nbsp; ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;index = arcpy.GetArgumentCount()-1&lt;BR /&gt;output1 = "out1"&lt;BR /&gt;arcpy.SetParameter(index , output1)&lt;BR /&gt;output2 = "out2"&lt;BR /&gt;arcpy.SetParameter(index+1, output2)&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2014 19:52:47 GMT</pubDate>
    <dc:creator>BakaryKoné</dc:creator>
    <dc:date>2014-06-23T19:52:47Z</dc:date>
    <item>
      <title>arcpy.SetParameter - Multiple output parameters</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-multiple-output-parameters/m-p/107647#M8311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to set more than one output parameter using arcpy.setparameter&amp;nbsp; ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;index = arcpy.GetArgumentCount()-1&lt;BR /&gt;output1 = "out1"&lt;BR /&gt;arcpy.SetParameter(index , output1)&lt;BR /&gt;output2 = "out2"&lt;BR /&gt;arcpy.SetParameter(index+1, output2)&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 19:52:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-multiple-output-parameters/m-p/107647#M8311</guid>
      <dc:creator>BakaryKoné</dc:creator>
      <dc:date>2014-06-23T19:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter - Multiple output parameters</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-multiple-output-parameters/m-p/107648#M8312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can have multiple output parameters. For example, the following takes 2 input parameters then creates 4 output values:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

n1 = float(arcpy.GetParameterAsText(0))
n2 = float(arcpy.GetParameterAsText(1))

out1 = n1 + n2
arcpy.SetParameter(2, out1)
out2 = n1 - n2
arcpy.SetParameter(3, out2)
out3 = n1 * n2
arcpy.SetParameter(4, out3)
out4 = n1 / n2
arcpy.SetParameter(5, out4)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Results:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]34829[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just make sure to set the Direction to Output in the Parameter properties when creating the script tool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]34830[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:31:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-multiple-output-parameters/m-p/107648#M8312</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2021-12-11T06:31:10Z</dc:date>
    </item>
  </channel>
</rss>

