<?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: Looking for a function which directly executes a python-toolbox and allows other geoprocessing tools to run simultaneously in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1317264#M10168</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It still doesnot work as intended. However, the combination of both of your propositions leads to an add-in which at least can open a map in the background. It's not possible to execute a geoprocessing tool while my toolbox is running.&lt;/P&gt;&lt;P&gt;this is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected override void OnClick()&lt;BR /&gt;{&lt;BR /&gt;string installPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);&lt;BR /&gt;string toolboxPath = Path.Combine(installPath, "toolbox.pyt\\Tool");&lt;BR /&gt;Geoprocessing.ExecuteToolAsync(toolboxPath,null,null,null,null, GPExecuteToolFlags.GPThread);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2023 05:32:22 GMT</pubDate>
    <dc:creator>nadja</dc:creator>
    <dc:date>2023-08-10T05:32:22Z</dc:date>
    <item>
      <title>Looking for a function which directly executes a python-toolbox and allows other geoprocessing tools to run simultaneously</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316111#M10155</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We developed a python toolbox with one python script. The script doesnot need any parameters set, it just needs to run multiple times. The toolbox is now integrated in an add-in, which works with "&lt;/SPAN&gt;Geoprocessing.OpenToolDialog(toolboxPath, null);" and then hitting run. Using this method, we could run the tool and still execute other geoprocessing tools.&lt;/P&gt;&lt;P&gt;Since we dont use any parameters, hitting "Run" is not needed. We found the "ExecuteToolAsync" which runs the tool, but async-style, meaning while this function is running, nothing else can be processed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need a function, which combines these two: clicking the add-in button will execute the function and it will be executed in a way, so that other geoprocessing tools can run too. Does such a function exist? and if yes, how is it called?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my Code from the Button.cs, which will be called in the Config.daml:&lt;/P&gt;&lt;P&gt;using ArcGIS.Core.CIM;&lt;BR /&gt;using ArcGIS.Core.Data;&lt;BR /&gt;using ArcGIS.Core.Geometry;&lt;BR /&gt;using ArcGIS.Desktop.Catalog;&lt;BR /&gt;using ArcGIS.Desktop.Core;&lt;BR /&gt;using ArcGIS.Desktop.Core.Geoprocessing;&lt;BR /&gt;using ArcGIS.Desktop.Editing;&lt;BR /&gt;using ArcGIS.Desktop.Extensions;&lt;BR /&gt;using ArcGIS.Desktop.Framework;&lt;BR /&gt;using ArcGIS.Desktop.Framework.Contracts;&lt;BR /&gt;using ArcGIS.Desktop.Framework.Dialogs;&lt;BR /&gt;using ArcGIS.Desktop.Framework.Threading.Tasks;&lt;BR /&gt;using ArcGIS.Desktop.Layouts;&lt;BR /&gt;using ArcGIS.Desktop.Mapping;&lt;BR /&gt;using System;&lt;BR /&gt;using System.Collections.Generic;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Text;&lt;BR /&gt;using System.Threading.Tasks;&lt;BR /&gt;using System.IO;&amp;nbsp;&lt;/P&gt;&lt;P&gt;namespace ToolTest&lt;BR /&gt;{&lt;BR /&gt;internal class Button1 : Button&lt;BR /&gt;{&lt;BR /&gt;protected async override void OnClick()&lt;BR /&gt;{&lt;BR /&gt;string installPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);&lt;BR /&gt;string toolboxPath = Path.Combine(installPath, "toolbox.pyt\\Tool");&lt;BR /&gt;await Geoprocessing.ExecuteToolAsync(toolboxPath,null,null,null,null, GPExecuteToolFlags.InheritGPOptions);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 17:18:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316111#M10155</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2023-08-07T17:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function which directly executes a python-toolbox and allows other geoprocessing tools to run simultaneously</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316151#M10156</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;You could try the code below (without await):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;protected override void OnClick()
{
string installPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string toolboxPath = Path.Combine(installPath, "toolbox.pyt\\Tool");
Geoprocessing.ExecuteToolAsync(toolboxPath,null,null,null,null, GPExecuteToolFlags.InheritGPOptions);
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Aug 2023 18:57:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316151#M10156</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-08-07T18:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function which directly executes a python-toolbox and allows other geoprocessing tools to run simultaneously</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316157#M10158</link>
      <description>&lt;P&gt;As the last parameter for ExecuteToolAsync call you can try 'GPExecuteToolFlags.GPThread'&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 19:09:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316157#M10158</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-08-07T19:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function which directly executes a python-toolbox and allows other geoprocessing tools to run simultaneously</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316842#M10165</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;&amp;nbsp;- thank you, unfortunately this didn't work for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 13:18:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316842#M10165</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2023-08-09T13:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function which directly executes a python-toolbox and allows other geoprocessing tools to run simultaneously</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316845#M10166</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;- thank you, unfortunately this didn't work for me. Do you have an other idea?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 13:20:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1316845#M10166</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2023-08-09T13:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function which directly executes a python-toolbox and allows other geoprocessing tools to run simultaneously</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1317264#M10168</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It still doesnot work as intended. However, the combination of both of your propositions leads to an add-in which at least can open a map in the background. It's not possible to execute a geoprocessing tool while my toolbox is running.&lt;/P&gt;&lt;P&gt;this is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected override void OnClick()&lt;BR /&gt;{&lt;BR /&gt;string installPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);&lt;BR /&gt;string toolboxPath = Path.Combine(installPath, "toolbox.pyt\\Tool");&lt;BR /&gt;Geoprocessing.ExecuteToolAsync(toolboxPath,null,null,null,null, GPExecuteToolFlags.GPThread);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 05:32:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/looking-for-a-function-which-directly-executes-a/m-p/1317264#M10168</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2023-08-10T05:32:22Z</dc:date>
    </item>
  </channel>
</rss>

