<?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: ExecuteToolAsync not adding resulting layer to map. in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823885#M2959</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am saying execute both tools in the python script using paths.&amp;nbsp; Then add what ever resulting data you want at the end in .NET using the method I gave you.&amp;nbsp; With the SDK ExecuteTool I don't think you can add outputs in the middle of a python script and then start it back up where it left off.&amp;nbsp; The ExecuteTool runs the entire python script and then adds the output.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Aug 2019 18:58:41 GMT</pubDate>
    <dc:creator>MatthewDriscoll</dc:creator>
    <dc:date>2019-08-02T18:58:41Z</dc:date>
    <item>
      <title>ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823872#M2946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a tool with python that I am running from an add-in using Geoprocessing.ExecuteToolAsync. My code gets the (x,y) center of the current map extent and makes x,y event layer from that point. I then attempt to run arcpy.conversion.LayerToKML tool. What I am finding is that the layer I create never gets added to the map/project even though I have tried specifying "GPExecuteToolFlags.AddOutputsToMap" and "GPExecuteToolFlags.Default ", which both are supposed to add all resulting layers to the map. The LayerToKML tool doesn't work if the layer being used isn't added to the project. I can get the code to run and create the layer that I want and save it using SaveToLayerFile_mangement, but how do I get it to add to the map. I have looked at the documentation extensively and haven't found anything helpful. Also I know the LayerToKML tool works through the ExecuteToolAsync because I can run it by itself (commented out other code and ran on layer added to map after creating with 1st part of script).&lt;/P&gt;&lt;P&gt;&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="keyword token"&gt;var&lt;/SPAN&gt; xE &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; middlePoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToString&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; yE &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; middlePoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToString&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; parameters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MakeValueArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;xE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; yE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; tool_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;@"PATH\Jwtools.tbx\Script"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; progDlg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ProgressDialog&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Running Geoprocessing Tool"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Cancel"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;100&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; progSrc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;CancelableProgressorSource&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;progDlg&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
progDlg&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Show&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; gp_result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;  &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ExecuteToolAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tool_path&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; parameters&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;CancelableProgressorSource&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;progDlg&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Progressor&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GPExecuteToolFlags&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddOutputsToMap&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; 
Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ShowMessageBox&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;gp_result&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Messages&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GP Messages"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; gp_result&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IsFailed &lt;SPAN class="operator token"&gt;?&lt;/SPAN&gt; GPMessageBoxStyle&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Error &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; GPMessageBoxStyle&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Default&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
progDlg&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Hide&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:48:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823872#M2946</guid>
      <dc:creator>JamalWest2</dc:creator>
      <dc:date>2021-12-12T09:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823873#M2947</link>
      <description>&lt;P&gt;Could you please check what option is set in Pro App's Project &amp;gt; Options &amp;gt; Geoprocessing and make sure 'Add output datasets to an open map' is checked?&amp;nbsp;&lt;/P&gt;&lt;P&gt;And which version of ArcGIS Pro you are on?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 22:01:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823873#M2947</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2021-08-18T22:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823874#M2948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"a"&amp;nbsp; is the path to the new layer created from the execution of the tool.&amp;nbsp;&amp;nbsp;&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="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&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;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
Map map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Active&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
LayerFactory&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Instance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; map&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:48:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823874#M2948</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2021-12-12T09:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823875#M2949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I shouldn't need to manually add the layer via sdk given that the ExecuteToolAsync is supposed to add the layer when it creates it. Using that means I have to generate the filename on the c#side or return it from my python tool. Do you know how to return it? In python I know how to generate unique file names, not in c# or the arcgis pro sdk.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 17:57:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823875#M2949</guid>
      <dc:creator>JamalWest2</dc:creator>
      <dc:date>2019-08-02T17:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823876#M2950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It also would mean I would have to create 2 separate python tools. One to create the layer, then use sdk code to ad it then execute a 2nd to run the process that I want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 17:58:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823876#M2950</guid>
      <dc:creator>JamalWest2</dc:creator>
      <dc:date>2019-08-02T17:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823877#M2951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Jamal West wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I shouldn't need to manually add the layer via sdk given that the ExecuteToolAsync is supposed to add the layer when it creates it. Using that means I have to generate the filename on the c#side or return it from my python tool. Do you know how to return it? In python I know how to generate unique file names, not in c# or the arcgis pro sdk.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Agreed!&amp;nbsp; Just showing you the way I know how.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I do think you can get the results from a python script over to the .NET, but the only way I personally would know how is if the python script is executed from the .NET solution.&amp;nbsp; &amp;nbsp;I think I have done this, let me take a look and think it over.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:06:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823877#M2951</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2019-08-02T18:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823878#M2952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought I responded to you already, but I guess it didn't post. Yes I am using the SDK to execute the python script. That's what the ExecuteToolAsync() does. I do not know how to get the results from the python script back to the SDK solution though. If you figure it out let me know please &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823878#M2952</guid>
      <dc:creator>JamalWest2</dc:creator>
      <dc:date>2019-08-02T18:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823879#M2953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes this would work and only be a couple additional lines of code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:23:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823879#M2953</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2019-08-02T18:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823880#M2954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you not specify the path of the xy layer results in the python script or are you using in memory?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:27:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823880#M2954</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2019-08-02T18:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823881#M2955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried both ways. Neither work. It only will work if that layer is added to the map.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:30:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823881#M2955</guid>
      <dc:creator>JamalWest2</dc:creator>
      <dc:date>2019-08-02T18:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823882#M2956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the path of the resulting XY layer path you should be able to just get it from the path and not the Map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the Code samples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;out_Layer&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;"firestations_layer"&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;saved_Layer&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;r"c:\output\firestations.lyr"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&amp;nbsp;&lt;SPAN class="" style="color: #4d4d4d;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;SaveToLayerFile_management&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;out_Layer&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;saved_Layer&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;) when saving the XY layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Then use&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;arcpy.env.workspace = &lt;/SPAN&gt;&lt;SPAN style="background-color: #f8f8f8; color: #c41a16; "&gt;r&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN style="color: #a31515;"&gt;"c:\output\&lt;/SPAN&gt;".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;Finally use&amp;nbsp;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;layers = arcpy.ListFiles(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;"*.lyr*"&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;) to get the Parameter layer.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:44:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823882#M2956</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2019-08-02T18:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823883#M2957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying in order to send it back to .NET or in order to specify the path? I have used it to specify the path and file and it doesn't work. I'm not sure how to send that back to the SDK source and then parse it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:50:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823883#M2957</guid>
      <dc:creator>JamalWest2</dc:creator>
      <dc:date>2019-08-02T18:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823884#M2958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are trying to add multiple outputs from the python script into the map.&amp;nbsp; The first is the XY event tool results, which you need to for the XML tool results.&amp;nbsp; So if you want to do it that way you will need two run to different scritps in two different Tasks probably. The SDK ExecuteTool will wait for the script to completely run before adding any outputs, it probably cannot know to stop python after one tool is ran and add the output and then restart python until the next output of the next tool.&amp;nbsp; So in this case yes you will need two scripts.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:55:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823884#M2958</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2019-08-02T18:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823885#M2959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am saying execute both tools in the python script using paths.&amp;nbsp; Then add what ever resulting data you want at the end in .NET using the method I gave you.&amp;nbsp; With the SDK ExecuteTool I don't think you can add outputs in the middle of a python script and then start it back up where it left off.&amp;nbsp; The ExecuteTool runs the entire python script and then adds the output.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:58:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823885#M2959</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2019-08-02T18:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823886#M2960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might be what I have to do for now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 19:14:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823886#M2960</guid>
      <dc:creator>JamalWest2</dc:creator>
      <dc:date>2019-08-02T19:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823887#M2961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also try adding the XY layer to the map with the python script using addLayer and then use the XML tool, if you do not want to use paths or two different scripts.&amp;nbsp; I just don't think the ExecuteTool can add any outputs until the full python script has been executed.&amp;nbsp; Good luck!&amp;nbsp; I might be over thinking things and someone can correct me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 19:23:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823887#M2961</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2019-08-02T19:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteToolAsync not adding resulting layer to map.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823888#M2962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before you do anything, first make sure the Geoprocessing options are set properly from Project menu.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From there, select Options &amp;gt; Geoprocessing and make sure to check mark 'Add Output datasets to an open ma' option -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/501065_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.Net code cannot override if the option is not set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2020 19:34:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/executetoolasync-not-adding-resulting-layer-to-map/m-p/823888#M2962</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2020-07-22T19:34:47Z</dc:date>
    </item>
  </channel>
</rss>

