<?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: Prevent arcpy functions from adding output to a map in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1057936#M61121</link>
    <description>&lt;P&gt;&lt;SPAN&gt;arcpy.env.addOutputsToMap = False&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/env.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/env.htm&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;addOutputsToMap (Boolean) - The tool's resulting output datasets will be added to the application display. The property is only applicable when used directly in the Python window or from a Notebook in ArcGIS Pro.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 May 2021 00:24:05 GMT</pubDate>
    <dc:creator>Tim_McGinnes</dc:creator>
    <dc:date>2021-05-14T00:24:05Z</dc:date>
    <item>
      <title>Prevent arcpy functions from adding output to a map</title>
      <link>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1057933#M61120</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Short version:&lt;/STRONG&gt; Is there some way to tell ArcPy functions running in Pro (command prompt or Notebook) whether or not to add the output as layers on a map? For example, ModelBuilder has an "Add to Display" variable to control whether a step's output is added to a map.&amp;nbsp;Is there some equivalent in ArcPy?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Python ArcPy functions running in the Python prompt or a Pro Notebook will add the output to your active map. That's either super handy or super annoying, depending on whether you want the function's output on your map. Sometimes I'm just working with data in an FGDB that has nothing to do with a map (e.g.: &lt;FONT face="courier new,courier" size="3" color="#993300"&gt;arcpy.management.AlterField&lt;/FONT&gt;) and layers start appearing on the map. Other times, I am interacting with a map, but my code has a bunch of intermediate steps that don't need to be on the map. Also, my code runs a LOT faster when it's not adding layers to the map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I close all my maps and run the code, this doesn't happen. After re-opening one or more maps, it may not start doing this again. So clearly I don't understand the how or the why about ArcPy adding layers to maps. I know how to programmatically add and remove the layers from the map, so I can solve this, but I'd rather be able to control whether they were added (or not) in the first place.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 23:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1057933#M61120</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2021-05-13T23:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent arcpy functions from adding output to a map</title>
      <link>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1057936#M61121</link>
      <description>&lt;P&gt;&lt;SPAN&gt;arcpy.env.addOutputsToMap = False&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/env.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/env.htm&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;addOutputsToMap (Boolean) - The tool's resulting output datasets will be added to the application display. The property is only applicable when used directly in the Python window or from a Notebook in ArcGIS Pro.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 00:24:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1057936#M61121</guid>
      <dc:creator>Tim_McGinnes</dc:creator>
      <dc:date>2021-05-14T00:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent arcpy functions from adding output to a map</title>
      <link>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1057938#M61122</link>
      <description>&lt;P&gt;Always on for me, try toggling it off&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="toggle.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/13329i6EA047B54BD9A6E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="toggle.png" alt="toggle.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 00:50:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1057938#M61122</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-05-14T00:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent arcpy functions from adding output to a map</title>
      <link>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1059675#M61174</link>
      <description>&lt;P&gt;I'm pretty sure I looked here for this, but jeez, it's the very first property under env in the docs, haha. Thanks, this works great!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 20:42:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1059675#M61174</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2021-05-19T20:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent arcpy functions from adding output to a map</title>
      <link>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1059677#M61175</link>
      <description>&lt;P&gt;I didn't try this, since I was looking for a solution in Python, but it seems like this would also do the trick using the GUI. The only issue with this I suppose is that you can't toggle it on/off/on/off during a script's execution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 20:44:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/prevent-arcpy-functions-from-adding-output-to-a/m-p/1059677#M61175</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2021-05-19T20:44:44Z</dc:date>
    </item>
  </channel>
</rss>

