<?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 Examples or documentation for Outputs in .pyt Python Toolboxes? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/examples-or-documentation-for-outputs-in-pyt/m-p/50362#M3949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having a devil of a time figuring out how outputs in ESRI Python toolboxes work. I can't either find usable examples or the proper documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My aim is this&lt;/P&gt;&lt;P&gt;1.) Allow the user to navigate to a gdb and provide a name for the output of the toolbox, from the toolbox dialog&lt;/P&gt;&lt;P&gt;2.) have the toolbox return results that aren't empty!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried everything under the sun. I simply want to provide the path and name that user provides from the dialog to this function.&lt;/P&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management(inp, outname,'"RND" = 1')&lt;/P&gt;&lt;P&gt;where outname is the user provided parameter&lt;/P&gt;&lt;P&gt;and have the results of this function be returned as an output of the tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently all that is returned is an empty FC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I run the logic of the code in the python window and predifine all the parameters I get the results I desired. So I am assuming that its error on my part on how the input parameters are being handled in the getParameterInfo(self) of the tbx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached my code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 May 2017 16:55:13 GMT</pubDate>
    <dc:creator>FredKellner2</dc:creator>
    <dc:date>2017-05-03T16:55:13Z</dc:date>
    <item>
      <title>Examples or documentation for Outputs in .pyt Python Toolboxes?</title>
      <link>https://community.esri.com/t5/python-questions/examples-or-documentation-for-outputs-in-pyt/m-p/50362#M3949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having a devil of a time figuring out how outputs in ESRI Python toolboxes work. I can't either find usable examples or the proper documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My aim is this&lt;/P&gt;&lt;P&gt;1.) Allow the user to navigate to a gdb and provide a name for the output of the toolbox, from the toolbox dialog&lt;/P&gt;&lt;P&gt;2.) have the toolbox return results that aren't empty!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried everything under the sun. I simply want to provide the path and name that user provides from the dialog to this function.&lt;/P&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management(inp, outname,'"RND" = 1')&lt;/P&gt;&lt;P&gt;where outname is the user provided parameter&lt;/P&gt;&lt;P&gt;and have the results of this function be returned as an output of the tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently all that is returned is an empty FC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I run the logic of the code in the python window and predifine all the parameters I get the results I desired. So I am assuming that its error on my part on how the input parameters are being handled in the getParameterInfo(self) of the tbx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached my code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 16:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/examples-or-documentation-for-outputs-in-pyt/m-p/50362#M3949</guid>
      <dc:creator>FredKellner2</dc:creator>
      <dc:date>2017-05-03T16:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Examples or documentation for Outputs in .pyt Python Toolboxes?</title>
      <link>https://community.esri.com/t5/python-questions/examples-or-documentation-for-outputs-in-pyt/m-p/50363#M3950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a quick look and the main difference I can see is that I have&lt;/P&gt;&lt;DIV&gt;import arcpy,os&lt;/DIV&gt;&lt;DIV&gt;# Set overwrite option&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;up the top of my script. Also, if the toolbox is loaded in ARCGIS Pro, right click and check the parameters in ARCGIS Pro.&amp;nbsp;&lt;BR /&gt;Otherwise it's a little hard to debug the code unless you are more specific about which inputs/outputs you are having trouble with.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2020 11:34:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/examples-or-documentation-for-outputs-in-pyt/m-p/50363#M3950</guid>
      <dc:creator>LeandraGordon</dc:creator>
      <dc:date>2020-06-27T11:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Examples or documentation for Outputs in .pyt Python Toolboxes?</title>
      <link>https://community.esri.com/t5/python-questions/examples-or-documentation-for-outputs-in-pyt/m-p/50364#M3951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MakeFeatureLayer creates a layer from the given feature class. A layer is not permanent and can only be saved in the project.&lt;/P&gt;&lt;P&gt;What you want is a feature class, which can be saved to a gdb or to your file system ( as shape file). Luckily, you can easily convert the layer into a feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change this line:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management(inp, outname,'"RND" = 1')&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;into:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;layer = arcpy.MakeFeatureLayer_management(inp, 'some_random_layer_name','"RND" = 1')&lt;/P&gt;&lt;P&gt;arcpy.CopyFeatures_management(layer, outname)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2020 07:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/examples-or-documentation-for-outputs-in-pyt/m-p/50364#M3951</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2020-07-01T07:18:14Z</dc:date>
    </item>
  </channel>
</rss>

