<?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 Python Scripting in ArcGIS Pro 2.2.1 in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-scripting-in-arcgis-pro-2-2-1/m-p/848625#M33853</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently evaluating ArcGIS Pro. I have created a python script to add a feature class of points created from a table. If I load the script directly into the ArcGIS Pro IDE the script runs successfully and adds the feature class to the map containing the points. However, if I run the same script through a toolbox or python toolbox, ArcGIS claims it ran successfully, but the feature class is not added. The toolbox creates the file and saves it in the current geodatabase, but I have to add it manually. Do you have to add additional code in the toolbox scripts to force the add of the feature class to the map?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2018 22:07:56 GMT</pubDate>
    <dc:creator>FreeTrial</dc:creator>
    <dc:date>2018-08-13T22:07:56Z</dc:date>
    <item>
      <title>Python Scripting in ArcGIS Pro 2.2.1</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-scripting-in-arcgis-pro-2-2-1/m-p/848625#M33853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently evaluating ArcGIS Pro. I have created a python script to add a feature class of points created from a table. If I load the script directly into the ArcGIS Pro IDE the script runs successfully and adds the feature class to the map containing the points. However, if I run the same script through a toolbox or python toolbox, ArcGIS claims it ran successfully, but the feature class is not added. The toolbox creates the file and saves it in the current geodatabase, but I have to add it manually. Do you have to add additional code in the toolbox scripts to force the add of the feature class to the map?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 22:07:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-scripting-in-arcgis-pro-2-2-1/m-p/848625#M33853</guid>
      <dc:creator>FreeTrial</dc:creator>
      <dc:date>2018-08-13T22:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting in ArcGIS Pro 2.2.1</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-scripting-in-arcgis-pro-2-2-1/m-p/848626#M33854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like we have an enhancement request asking for the difference to be better explained in the help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[&lt;SPAN style="color: #2b2826; background-color: #ffffff;"&gt;ENH-000105422:&amp;nbsp;&lt;SPAN&gt;Please document differences in the addOutputsToMap environment setting between scripts run from a toolbox and scripts run from the Python window.]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b2826; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b2826; background-color: #ffffff;"&gt;&lt;SPAN&gt;From that request, "&lt;SPAN style="background-color: #ffffff;"&gt;In ArcGIS Pro, when the addOutputsToMap environment property is set to True, and a script is run from the Python window, a new layer created in the script is automatically added to an open map. This is not the case when running a script from a toolbox. In the latter case, it is necessary for the script to have an output parameter for the layer or feature class created in the script. The parameter can be either Output or Derived, but the new layer won't be added to the map unless such a parameter is present."&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b2826; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b2826; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;So to answer your question, yes, there is a difference and if running from a toolbox, you'll need to modify the script slightly to create an output parameter for the layer or feature class created in the script.&amp;nbsp; Hope this helps.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 13:41:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-scripting-in-arcgis-pro-2-2-1/m-p/848626#M33854</guid>
      <dc:creator>KoryKramer</dc:creator>
      <dc:date>2018-08-14T13:41:50Z</dc:date>
    </item>
  </channel>
</rss>

