<?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: Create a Custom Add-In Button that link to Tools in Toolbox in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1315734#M10151</link>
    <description>&lt;P&gt;I am having the same issue. Calling OpenToolDialog with a path to a script within a toolset results in the same error as&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/595385"&gt;@ManalSiddiqui&lt;/a&gt;&amp;nbsp;: "&lt;SPAN&gt;Tool has failed to open: Error HRESULT E_FAIL has been returned from a call to a COM component.". Moving the script to the top level of the toolbox fixes the issue, but that is a impractical solution for a toolbox that is neatly organized with dozens of tools.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2023 21:47:07 GMT</pubDate>
    <dc:creator>Kristofer-Sentry</dc:creator>
    <dc:date>2023-08-04T21:47:07Z</dc:date>
    <item>
      <title>Create a Custom Add-In Button that link to Tools in Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1185727#M8287</link>
      <description>&lt;P&gt;So I am currently trying to link&lt;SPAN&gt;&amp;nbsp;to create an Add-In and link it to the tool located in the toolbox. So the add-in button would work like a shortcut in a way instead of trying to dig out the tools from the geoprocessing pane. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am aware of creating a customized&amp;nbsp;ribbon which links to the tools (see video below) however this would only be specific to one project. I need to make the add-ins more versatile, so they can be used in any project whereas this ribbon would be specific to just one project.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6308407747112w864h540r62" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6308407747112" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6308407747112w864h540r62');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6308407747112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I would like to make the buttons to look exactly like this but within the Add-In ribbon. I have looked at resources where they execute the tool with commands similar to the one&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing" target="_self"&gt; in this website&lt;/A&gt;. The main execution is done by :&lt;/P&gt;&lt;PRE&gt;Geoprocessing.ExecuteToolAsync(ToolPath, Parameters, Environments);&lt;/PRE&gt;&lt;P&gt;Where the toolpath is linked to the tool I am trying to open in the geoprocessing pane, however it does not work as there is something going wrong with the path (what I suspect). When I try to run that code, it seems to be giving me an error similar to the last post &lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/check-if-toolbox-tool-exists-before-opening-it/m-p/806100/highlight/true#M2178" target="_self"&gt;in this forum.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There should be some way to link the add-in to the feature but I am not sure where it is going wrong. Any help would be great!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 20:19:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1185727#M8287</guid>
      <dc:creator>ManalSiddiqui</dc:creator>
      <dc:date>2022-06-23T20:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Add-In Button that link to Tools in Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1185821#M8289</link>
      <description>&lt;P&gt;For System toolbox tools, either specifying the full path to the Toolbox &lt;STRONG&gt;&lt;EM&gt;or&lt;/EM&gt;&lt;/STRONG&gt; using the convention "ToolboxName.ToolName" are equivalent.&lt;/P&gt;&lt;P&gt;so, for example, these are both equivalent:&lt;/P&gt;&lt;P&gt;var path = @"C:\&amp;lt;ArcGIS Pro Install Path&amp;gt;\Resources\ArcToolBox\Toolboxes\Analysis Tools.tbx";&lt;BR /&gt;var long_tool_name = System.IO.Path.Combine(path, "Buffer");&lt;/P&gt;&lt;P&gt;var short_tool_name = "analysis.Buffer";&lt;/P&gt;&lt;P&gt;With a custom tool, as it is _not_ a &lt;EM&gt;System&lt;/EM&gt;&amp;nbsp;toolbox tool, then u will always default to the fully qualified path to the toolbox - i.e. what I show as "long_tool_name" above (only the path to the toolbox will be whatever is the relevant full path to your custom toolbox in question).&lt;/P&gt;&lt;P&gt;Geoprocessing.OpenToolDialog(...) can then be invoked with the relevant toolbox name and parameters - the parameters will be used to prepopulate the corresponding fields on the tool dialog.&lt;/P&gt;&lt;P&gt;One last point, it is always best to call&amp;nbsp;Geoprocessing.OpenToolDialog(...) on the &lt;STRONG&gt;UI&lt;/STRONG&gt; thread and _&lt;STRONG&gt;not&lt;/STRONG&gt;_ on the QueuedTask. If the Geoprocessing Dockpane has not been opened at least once before during the current session then&amp;nbsp;Geoprocessing.OpenToolDialog(...) must create the dockpane before showing the tool page (hosted in the GP dockpane).&lt;/P&gt;&lt;P&gt;If&amp;nbsp;Geoprocessing.OpenToolDialog(...) is called on the QueuedTask then creation of the GP dockpane fails (if the GP dialog has not been created for the session) and nothing will be shown.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class ShowGPDialogButton : Button {

  protected async override void OnClick()
  {
    var map = MapView.Active.Map;

    var extent = MapView.Active.Extent;
    var path = @"C:\ArcGIS\Resources\ArcToolBox\Toolboxes\Analysis Tools.tbx";
    //these are equivalent for a System tool
    var long_tool_name = System.IO.Path.Combine(path, "Buffer");
    var short_tool_name = "analysis.Buffer";

    var tool_name = long_tool_name;//or can use short_tool_name for System tools

    var val_array = await QueuedTask.Run(() =&amp;gt; {
      //make a geometry for the buffer
      var center_pt = MapPointBuilderEx.CreateMapPoint(
                               MapView.Active.Camera.X, 
                               MapView.Active.Camera.Y,
                               MapView.Active.Camera.SpatialReference);

      var geom = new List&amp;lt;object&amp;gt;() { center_pt };
      //set up some params for Buffer
      return Geoprocessing.MakeValueArray(new object[] { geom, null, @"1000 Meters" });
    });
    //Show the tool page - call OpenToolDialog on the UI
    Geoprocessing.OpenToolDialog(tool_name, val_array, null, false);
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 22:44:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1185821#M8289</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2022-06-23T22:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Add-In Button that link to Tools in Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1186190#M8293</link>
      <description>&lt;P&gt;Similar to the error I was getting before, it is unable to find the tool.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ManalSiddiqui_0-1656093663085.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44359i39A7DD9A399D8602/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ManalSiddiqui_0-1656093663085.png" alt="ManalSiddiqui_0-1656093663085.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This custom tool is a script so would that change anything as it does not really act as a "Buffer"? Also another thing is that the path to the tool within the toolbox is as it shows in ArcGIS but I am thinking something is going wrong with the path.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 18:03:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1186190#M8293</guid>
      <dc:creator>ManalSiddiqui</dc:creator>
      <dc:date>2022-06-24T18:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Add-In Button that link to Tools in Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1186251#M8294</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having a path separator in your toolname does not seem correct- "\Archive Imagery&lt;STRONG&gt;\&lt;/STRONG&gt;ArchiveImagerySearch"?&lt;/P&gt;&lt;P&gt;Here is a Pro SDK sample:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geoprocessing/DeepThought" target="_self"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geoprocessing/DeepThought&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It contains a python toolbox: "DeepThought.tbx". It has a tool "answer.py" with a toolname "Answer"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="script-toolbox.png" style="width: 837px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44371iCA84A96D7196660A/image-size/large?v=v2&amp;amp;px=999" role="button" title="script-toolbox.png" alt="script-toolbox.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="script-toolbox2.png" style="width: 540px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44372i544829E2024AD3A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="script-toolbox2.png" alt="script-toolbox2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class ShowGPDialogButton : Button {
  protected override void OnClick()
  {
    var tool_path =
     @"E:\Data\SDK\Migration\DeepThought-ProAddin\Toolboxes\toolboxes\DeepThought.tbx";
    var tool_name = System.IO.Path.Combine(tool_path, "Answer");
    //map just so happens to be of Portland
    var wkid = MapView.Active.Map.SpatialReference.Wkid;
    var env_array = Geoprocessing.MakeEnvironmentArray(outputCoordinateSystem: $"{wkid}");
    Geoprocessing.OpenToolDialog(tool_name, null, env_array);
 }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;results in:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gp_tool.png" style="width: 382px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44373i5E3099FC721A972E/image-size/large?v=v2&amp;amp;px=999" role="button" title="gp_tool.png" alt="gp_tool.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map_sr.png" style="width: 355px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44374i35B854E152DD0CFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="map_sr.png" alt="map_sr.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>Fri, 24 Jun 2022 19:37:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1186251#M8294</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2022-06-24T19:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Add-In Button that link to Tools in Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1187303#M8309</link>
      <description>&lt;P&gt;&lt;BR /&gt;So as I suspected, the subfolder was the problem. I am only able to launch the tool if it is directly in the toolbox, however being in a subfolder within the toolbox makes it crash. Would you know the cause of this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-06-28 at 10.38.06 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44637i683DAA4B0853BD00/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-06-28 at 10.38.06 AM.png" alt="Screen Shot 2022-06-28 at 10.38.06 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 14:39:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1187303#M8309</guid>
      <dc:creator>ManalSiddiqui</dc:creator>
      <dc:date>2022-06-28T14:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Add-In Button that link to Tools in Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1315734#M10151</link>
      <description>&lt;P&gt;I am having the same issue. Calling OpenToolDialog with a path to a script within a toolset results in the same error as&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/595385"&gt;@ManalSiddiqui&lt;/a&gt;&amp;nbsp;: "&lt;SPAN&gt;Tool has failed to open: Error HRESULT E_FAIL has been returned from a call to a COM component.". Moving the script to the top level of the toolbox fixes the issue, but that is a impractical solution for a toolbox that is neatly organized with dozens of tools.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 21:47:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1315734#M10151</guid>
      <dc:creator>Kristofer-Sentry</dc:creator>
      <dc:date>2023-08-04T21:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Add-In Button that link to Tools in Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1371570#M11011</link>
      <description>&lt;P&gt;I am trying to create an Add-in and link it to a system tool, as shown in your video. Can you please provide guidance on how to code it correctly? I am experiencing some issues with the implementation.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 13:18:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1371570#M11011</guid>
      <dc:creator>LuckyLuke84698</dc:creator>
      <dc:date>2024-01-18T13:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Custom Add-In Button that link to Tools in Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1575578#M12497</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/595385"&gt;@ManalSiddiqui&lt;/a&gt;&amp;nbsp;&amp;nbsp;How can this be done for ArcServer published Geoprocessing tools that have a URL instead of a path?&amp;nbsp; Cannot seem to get anything to work for it.&amp;nbsp; Regular toolboxes work but not a URL based publish one.&lt;/P&gt;&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 20:10:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-add-in-button-that-link-to-tools/m-p/1575578#M12497</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2025-01-14T20:10:20Z</dc:date>
    </item>
  </channel>
</rss>

