<?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: Change or read Geoprocessing Options in Add-Ins in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030430#M6252</link>
    <description>&lt;P&gt;Thank you very much!. You gave me a good hint. Unfortunately I can not expect that the users of the&amp;nbsp; Add-In will install SysInternal ProcessMonitor. But at least thanks to you I know where is the config information stored&lt;/P&gt;</description>
    <pubDate>Thu, 25 Feb 2021 14:10:07 GMT</pubDate>
    <dc:creator>Eloy</dc:creator>
    <dc:date>2021-02-25T14:10:07Z</dc:date>
    <item>
      <title>Change or read Geoprocessing Options in Add-Ins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1029990#M6249</link>
      <description>&lt;P&gt;Is there a way to change or at least to read&amp;nbsp; geoprocessing options such as "Add output dataset to an open map" in &amp;nbsp;Add-Ins?&lt;/P&gt;&lt;P&gt;I am working with a table in "&lt;EM&gt;memory&lt;/EM&gt;" that is created with a geoprocess and after its creation is added to the TOC in&amp;nbsp;Standalone Tables.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;Geoprocessing.ExecuteToolAsync("management.CreateTable", tableParams, null, null, null, GPExecuteToolFlags.&lt;FONT color="#0000FF"&gt;AddOutputsToMap&lt;/FONT&gt;);&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;If the above mentioned geoprocessing option is not checked,&amp;nbsp;the table will&amp;nbsp;not be added to the TOC, making impossible to insert or read rows in the recently created table in “&lt;EM&gt;memory&lt;/EM&gt;”. At least I would like to read the geoprocessing options in the Add-In so I can create the table in the &lt;EM&gt;DefaultGeodatabasePath&lt;/EM&gt; instead of in “&lt;EM&gt;memory&lt;/EM&gt;” when the option is not checked.&lt;/P&gt;&lt;P&gt;I would appreciate any suggestion. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 14:17:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1029990#M6249</guid>
      <dc:creator>Eloy</dc:creator>
      <dc:date>2021-02-24T14:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change or read Geoprocessing Options in Add-Ins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030011#M6250</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;GPExecuteToolFlags.AddOutputsToMap and&amp;nbsp;GPExecuteToolFlags.Default flags adds outputs to the map.&lt;/P&gt;&lt;P&gt;You can manage all available flags as you want or as you need.&lt;/P&gt;&lt;P&gt;(&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic9375.html" target="_self"&gt;https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic9375.html&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;More info about "in_memory" workspace problems here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/in-memory-workspace/m-p/787033#M1303" target="_self"&gt;https://community.esri.com/t5/arcgis-pro-sdk-questions/in-memory-workspace/m-p/787033#M1303&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 15:13:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030011#M6250</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2021-02-24T15:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change or read Geoprocessing Options in Add-Ins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030068#M6251</link>
      <description>&lt;P&gt;I started Pro and went to Settings&amp;gt;Options&amp;gt;Geoprocessing.&lt;/P&gt;&lt;P&gt;I downloaded, installed and started &lt;A href="https://docs.microsoft.com/en-us/sysinternals/downloads/procmon" target="_self"&gt;SysInternals ProcessMonitor&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I dragged the "Include Process from Window" icon and dropped it onto the Options window.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_0-1614186069171.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6793i39720AF98F363F45/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_0-1614186069171.png" alt="KirkKuykendall1_0-1614186069171.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added two Filters to process Monitor:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_2-1614185687991.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6790i41915C8BC1F352E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_2-1614185687991.png" alt="KirkKuykendall1_2-1614185687991.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I unchecked the "add outputs to open map" option, and clicked save.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_3-1614185730160.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6791iAC33C3D73FCF2219/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_3-1614185730160.png" alt="KirkKuykendall1_3-1614185730160.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;ProcessMonitor shows Pro is writing to :&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Users\kirkk\AppData\Roaming\Esri\ArcGISPro.exe_StrongName_yhpsrysqpn4fvmb0spwbakt5o5e50din\2.7.0.0\user.config&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I open the file in notepad and see xml setting for AddOutputsToMap set to false.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_0-1614185178060.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6787iB9A40FC2BB00CC2D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_0-1614185178060.png" alt="KirkKuykendall1_0-1614185178060.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 17:01:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030068#M6251</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-02-24T17:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Change or read Geoprocessing Options in Add-Ins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030430#M6252</link>
      <description>&lt;P&gt;Thank you very much!. You gave me a good hint. Unfortunately I can not expect that the users of the&amp;nbsp; Add-In will install SysInternal ProcessMonitor. But at least thanks to you I know where is the config information stored&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 14:10:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030430#M6252</guid>
      <dc:creator>Eloy</dc:creator>
      <dc:date>2021-02-25T14:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change or read Geoprocessing Options in Add-Ins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030526#M6253</link>
      <description>&lt;P&gt;End users don't need ProcessMonitor.&amp;nbsp; Programmers dealing with undocumented software features do though.&lt;/P&gt;&lt;P&gt;Now that you know where the setting is getting saved, you can write code to read it, like this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;protected override void OnClick()
{
    string cfgFile = GetConfigFile();
    if(cfgFile != null)
    {
        var isAddingOutputToMap = GetAddOutputsToMap(cfgFile);
        Debug.Print($"add output to map: {isAddingOutputToMap}");
    }
}
private string GetConfigFile()
{
    var roaming = Environment
                .ExpandEnvironmentVariables("%APPDATA%");

    var esriFolder = System.IO.Path.Combine(roaming, "Esri");
    //config files for older versions may be present too ...
    var cfgFiles = Directory.GetFiles(esriFolder,
        "user.config", SearchOption.AllDirectories);
    var ver = FrameworkApplication.ResourceAssembly
                .GetName().Version.ToString();
    var cfgFile = cfgFiles.Where(f =&amp;gt;
    f.Contains("ArcGISPro.exe") &amp;amp;&amp;amp;
    f.Contains($"{ver}\\user.config")).FirstOrDefault();
    return cfgFile;
}
private bool GetAddOutputsToMap(string cfgFile)
{
    var xdoc = XDocument.Load(cfgFile);
    var gpSettings = xdoc.Element("configuration")
        .Elements("userSettings")
        .Elements("ArcGIS.Desktop.GeoProcessing.Properties.Settings")
        .FirstOrDefault();

    var node = gpSettings.Elements()
        .Where(e =&amp;gt; e.Attribute("name").Value == "AddOutputsToMap")
        .FirstOrDefault();
    return node.Element("value").Value.ToUpper() == "TRUE";
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Feb 2021 16:37:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030526#M6253</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-02-25T16:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change or read Geoprocessing Options in Add-Ins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030900#M6268</link>
      <description>&lt;P&gt;Thank your very much!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 07:38:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-or-read-geoprocessing-options-in-add-ins/m-p/1030900#M6268</guid>
      <dc:creator>Eloy</dc:creator>
      <dc:date>2021-02-26T07:38:03Z</dc:date>
    </item>
  </channel>
</rss>

