<?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: MakeFeatureLayer doesn't add result to MXD when run as tool in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110840#M8614</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should be able to just check this option in the attached screenshot under Geoprocessing Options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Add results of geoprocessing operations to the display.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Sep 2012 12:21:55 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-09-12T12:21:55Z</dc:date>
    <item>
      <title>MakeFeatureLayer doesn't add result to MXD when run as tool</title>
      <link>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110838#M8612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been having some issues with MakeFeatureLayer not adding its result to the MXD. I made a script with just the following lines to root out the problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;fc = arcpy.GetParameterAsText(0) arcpy.MakeFeatureLayer_management(fc, arcpy.Describe(fc).name + "_test")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I run these from the Python window the layer is added. But if I save them to a script and use that in a tool, it executes with no errors but won't add anything to the data frame. If I run ListLayers it isn't there either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know what I have to do to hunt down this layer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 22:25:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110838#M8612</guid>
      <dc:creator>RobertMartin2</dc:creator>
      <dc:date>2012-09-11T22:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: MakeFeatureLayer doesn't add result to MXD when run as tool</title>
      <link>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110839#M8613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="plain" name="code"&gt;test_lyr = arcpy.Describe(fc).name + "_test" mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] # choose the correct DataFrame lyr = arcpy.mapping.Layer(test_lyr) # insert your layer-name arcpy.mapping.AddLayer(df, lyr, "TOP") # choose position in TOC arcpy.RefreshTOC()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;search the help for more examples:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s300000025000000" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s300000025000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 06:35:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110839#M8613</guid>
      <dc:creator>FabianBlau</dc:creator>
      <dc:date>2012-09-12T06:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: MakeFeatureLayer doesn't add result to MXD when run as tool</title>
      <link>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110840#M8614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should be able to just check this option in the attached screenshot under Geoprocessing Options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Add results of geoprocessing operations to the display.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 12:21:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110840#M8614</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-09-12T12:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: MakeFeatureLayer doesn't add result to MXD when run as tool</title>
      <link>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110841#M8615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I dropped in Fabian's code block and it worked like a charm. Now if I could just figure out why it takes six lines of code to do something that's automatic in the Python window... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mathew, I checked my settings and that box was checked all along. Maybe it doesn't apply to scripts run as tools?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks guys!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 16:47:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/makefeaturelayer-doesn-t-add-result-to-mxd-when/m-p/110841#M8615</guid>
      <dc:creator>RobertMartin2</dc:creator>
      <dc:date>2012-09-12T16:47:38Z</dc:date>
    </item>
  </channel>
</rss>

