<?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: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700142#M54255</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua. I sent the bug report days ago to ESRI Tech Support (Local Distributor), they&amp;nbsp;are still evaluating it.&lt;/P&gt;&lt;P&gt;Can you post the&amp;nbsp;link of the bug please? I can't find it.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Aug 2018 00:30:23 GMT</pubDate>
    <dc:creator>simoxu</dc:creator>
    <dc:date>2018-08-17T00:30:23Z</dc:date>
    <item>
      <title>MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700134#M54247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addOutputsToMap&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeTableView_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"&amp;lt;workspace&amp;gt;\\RDA.DBO.Immediate_Assessment"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"tmp_tbl"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;where_clause&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# &amp;lt;Result 'tmp_tbl'&amp;gt;&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'tmp_tbl'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 17492, in GetCount&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 17489, in GetCount&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retval = convertArcObjectToPythonObject(gp.GetCount_management(*gp_fixargs((in_rows,), True)))&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 496, in &amp;lt;lambda&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args, True))&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Error in sys.excepthook:&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Traceback (most recent call last):&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Python\Core\ptvsd\debugger.py", line 2409, in _excepthook&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_exception(exc_type, exc_value, exc_tb)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Python\Core\ptvsd\debugger.py", line 2656, in print_exception&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.stdout.write(out)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# AttributeError: 'NoneType' object has no attribute 'write'&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# &lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Original exception was:&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Traceback (most recent call last):&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 17492, in GetCount&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py", line 17489, in GetCount&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retval = convertArcObjectToPythonObject(gp.GetCount_management(*gp_fixargs((in_rows,), True)))&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp; File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 496, in &amp;lt;lambda&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args, True))&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# ERROR 000732: Input Rows: Dataset tmp_tbl does not exist or is not supported&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Failed to execute (GetCount).&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the&amp;nbsp;arcpy.env.addOutputsToMap is set to True, the same code will work.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addOutputsToMap&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeTableView_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"&amp;lt;workspace&amp;gt;\\RDA.DBO.Immediate_Assessment"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"tmp_tbl"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;where_clause&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'tmp_tbl'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# &amp;lt;Result '45'&amp;gt;‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I really want to do is the same as the Python following example, but I don't want to add the temporary layer to the map (the code should not rely on an active map in my case)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# Name: DeleteFeatures_Example2.py&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Description: Delete features from a feature class based on an expression&lt;/SPAN&gt;
 
&lt;SPAN class="comment token"&gt;# Import system modules&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
 
&lt;SPAN class="comment token"&gt;# Set environment settings&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:/data/airport.gdb"&lt;/SPAN&gt;
 
&lt;SPAN class="comment token"&gt;# Set local variables&lt;/SPAN&gt;
inFeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"parcels"&lt;/SPAN&gt;
outFeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:/output/output.gdb/new_parcels"&lt;/SPAN&gt;
tempLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"parcelsLayer"&lt;/SPAN&gt;
expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddFieldDelimiters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempLayer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PARCEL_ID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" = 'Cemetery'"&lt;/SPAN&gt;
 

&lt;SPAN class="comment token"&gt;# Execute CopyFeatures to make a new copy of the feature class&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outFeatures&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 
&lt;SPAN class="comment token"&gt;# Execute MakeFeatureLayer&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tempLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 
&lt;SPAN class="comment token"&gt;# Execute SelectLayerByAttribute to determine which features to delete&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempLayer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expression&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 
&lt;SPAN class="comment token"&gt;# Execute GetCount and if some features have been selected, then &lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#&amp;nbsp; execute DeleteFeatures to remove the selected features.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DeleteFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code is from ESRI help document:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete-features.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete-features.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Delete Features—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the question is:&lt;/P&gt;&lt;P&gt;Can we make in-memory feature layers or tables without adding them to a map?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:28:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700134#M54247</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2021-12-12T05:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700135#M54248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From here....&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/appendices/using-the-in-memory-output-workspace.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/appendices/using-the-in-memory-output-workspace.htm"&gt;Considerations when using the in_memory workspace—Appendices | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;results are temporary&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Data written to the in_memory workspace is temporary and will be lost when the application is closed, making in_memory ideal for intermediate data created from model and Python script tools. &lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and with Delete being available, why would you be concerned about results being added to the map?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2018 10:10:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700135#M54248</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-08-02T10:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700136#M54249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan.&lt;/P&gt;&lt;P&gt;I am concerned that the temporary layer will mess up one of my maps. If I have an active map this will be my active map otherwise this will be first map in my map list (I guess...)&lt;/P&gt;&lt;P&gt;Although I can delete the records in the temp layer, but I assume the layer itself will still be listed in the content pane.&lt;/P&gt;&lt;P&gt;The point is, in my case I don't have a need to visualize this intermediate layer/table.&lt;/P&gt;&lt;P&gt;Hope this make sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 06:36:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700136#M54249</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-08-10T06:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700137#M54250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you aren't adding the feature layer or table view to a map, you need to pass an object reference to other geoprocessing tools, not just the label:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addOutputsToMap&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;

res &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeTableView_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"workspace&amp;gt;\\RDA.DBO.Immediate_Assessment"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"tmp_tbl"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; where_clause
&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; res&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The strings people commonly pass to geoprocessing tools are a kind of shorthand, a label, for an object.&amp;nbsp; ArcPy uses that label to search an index of sorts to get a reference to the object.&amp;nbsp; When &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;addOutputsToMap&lt;/SPAN&gt; is &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;False&lt;/SPAN&gt; the feature layer or table view isn't added to that index because it isn't part of any map, which is why you see the error that the dataset doesn't exist.&amp;nbsp; When &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;addOutputsToMap&lt;/SPAN&gt; is &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;False&amp;nbsp;&lt;/SPAN&gt; the object is created, you just need to capture a reference to the object from the result object returned from the geoprocessing tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700137#M54250</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-12T05:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700138#M54251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua.&lt;/P&gt;&lt;P&gt;I've tried that but no success.&lt;/P&gt;&lt;P&gt;Please have a look at the screenshot.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Python environment in ArcGIS Pro" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/418536_tmp_tbl.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 06:43:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700138#M54251</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-08-13T06:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700139#M54252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although the Esri document link in the original question was for Pro, I wasn't sure you were working in Pro.&amp;nbsp; The code I posted works in ArcMap/ArcCatalog, which is where I have done something similar before.&amp;nbsp; I just tried it in Pro, and it does not work because the Result object from the geoprocessing tool isn't returning a reference to the object like in ArcMap.&amp;nbsp; I believe this should qualify as an equivalence bug if you open a case with Esri Support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 13:39:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700139#M54252</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-08-13T13:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700140#M54253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good idea.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 01:36:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700140#M54253</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-08-14T01:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700141#M54254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I logged a bug with Esri Support, you can attach your organization to it instead of submitting another one:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;BUG-000116163 : In ArcGIS Pro when arcpy.env.AddOutputsToMap is set to False, the object fails to exist&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 19:37:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700141#M54254</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-08-16T19:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700142#M54255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua. I sent the bug report days ago to ESRI Tech Support (Local Distributor), they&amp;nbsp;are still evaluating it.&lt;/P&gt;&lt;P&gt;Can you post the&amp;nbsp;link of the bug please? I can't find it.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2018 00:30:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700142#M54255</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-08-17T00:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700143#M54256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The tech support has been informed about this bug, so that they don’t need to double handle it. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2018 13:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700143#M54256</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-08-17T13:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700144#M54257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any&amp;nbsp;news on this bug? I have a script that copies thousands of features, performs analysis and then deletes the copies. When I run this script in the Python window in ArcGIS Pro, the features copy to the TOC (ex. feature_new), and then are deleted. However, each time this happens, &lt;EM&gt;another&lt;/EM&gt; copy with the original feature name and a number (ex. feature_old26) is created in the TOC, and remains after the script moves on to the next feature. So I have thousands of these in the TOC. If I use&amp;nbsp;arcpy.env.addOutputsToMap = False in the script, it fails.&amp;nbsp;&lt;STRONG&gt;ERROR 000732: Input Features: Dataset feature_old26 does not exist or is not supported&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2019 18:01:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700144#M54257</guid>
      <dc:creator>deleted-user-1_r2dgYuILKY</dc:creator>
      <dc:date>2019-03-27T18:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700145#M54258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am also getting this error. Has there been any resolution Yet?&amp;nbsp; I can run my script alone in IDEL but when I'm running it in Notebooks it want's to add my hundreds of layers to the map which I don't need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2020 19:34:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700145#M54258</guid>
      <dc:creator>JacqueHamilton</dc:creator>
      <dc:date>2020-10-01T19:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700146#M54259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any resolution to this problem in ArcPro?&amp;nbsp; I'm running Notebooks in ArcPro.&amp;nbsp;&amp;nbsp;#&lt;SPAN style="background-color: #f6f6f6;"&gt;BUG-000116163 : In ArcGIS Pro when arcpy.env.AddOutputsToMap is set to False, the object fails to exist&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2020 19:36:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700146#M54259</guid>
      <dc:creator>JacqueHamilton</dc:creator>
      <dc:date>2020-10-01T19:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700147#M54260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, no:&amp;nbsp; &lt;A class="link-titled" href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDExNjE2Mw==" title="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDExNjE2Mw=="&gt;BUG-000116163: In ArcGIS Pro, when arcpy.env.AddOutputsToMap is set..&lt;/A&gt;&amp;nbsp; The "In Product Plan" means they acknowledge a defect, but they won't commit to when it will be addressed.&amp;nbsp; Given the defect was logged 2 years ago, "In Product Plan" is about as reassuring as "the check is in the mail."&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2020 22:12:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700147#M54260</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-10-01T22:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: MakeTableView_management and MakeFeatureLayer_management won't work if arcpy.env.addOutputsToMap is set to False</title>
      <link>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700148#M54261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the update and the link to the notification. I added myself to the notify list when it gets fixed. I guess I won't be using Notebooks in ArcPro any time soon. Not until they fix this. I hate having to manually delete the hundreds of temp layer files and shapefiles that get added the map when I'm running my model.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2020 16:16:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/maketableview-management-and-makefeaturelayer/m-p/700148#M54261</guid>
      <dc:creator>JacqueHamilton</dc:creator>
      <dc:date>2020-10-02T16:16:36Z</dc:date>
    </item>
  </channel>
</rss>

