<?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: Call ArcHydro tools using ArcGIS Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301557#M9955</link>
    <description>&lt;P&gt;Thanks a lot for your help.&amp;nbsp; I am able to get it work now.&amp;nbsp; The key is the GP tool name.&amp;nbsp; It should be "Fill_sa" as you indicated.&amp;nbsp; But it only takes 2 parameters in Pro SDK though.&amp;nbsp; It would be better if users can specify z_limit.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2023 15:31:58 GMT</pubDate>
    <dc:creator>AquanuityDevelopment</dc:creator>
    <dc:date>2023-06-21T15:31:58Z</dc:date>
    <item>
      <title>Call ArcHydro tools using ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301324#M9950</link>
      <description>&lt;P&gt;I just could not get ArcHydro tool to work using ArcGIS Pro SDK.&amp;nbsp; The following is a block of my code.&amp;nbsp; Any hep will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;string sIputRaster = @"C:\Support\ESRI_LocalGovernment.gdb\FiveMeterSurface";&lt;BR /&gt;string sRaterPath = @"C:\Support\Fill.tif";&lt;BR /&gt;&lt;BR /&gt;var parameters = Geoprocessing.MakeValueArray(sIputRaster, sRaterPath);&lt;/P&gt;&lt;P&gt;var cts = new CancellationTokenSource();&lt;BR /&gt;var results = await Geoprocessing.ExecuteToolAsync("Fill", parameters, null, cts.Token,&lt;BR /&gt;(eventName, o) =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;}, GPExecuteToolFlags.None);&lt;BR /&gt;if (results.IsFailed)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;MessageBox.Show("Failed to create fill layer. Error " + results.ErrorCode);&lt;/P&gt;&lt;P&gt;return;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 22:16:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301324#M9950</guid>
      <dc:creator>AquanuityDevelopment</dc:creator>
      <dc:date>2023-06-20T22:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Call ArcHydro tools using ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301455#M9952</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Spatial Analyst has its own way of setting parameters for tools which have return value. They order differs in Python and .NET. Because Fill tool has 2 input parameters and 1 output, so output parameter could be in third place. You need to check it. Set for example 1 for z_limit.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/fill.htm" target="_self"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/fill.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another one thing I am not sure about geoprocessing tool name. It could be named like "Fill_sa" as other spatial analyst tools which I have used. For example "Reclassify_sa",&amp;nbsp;"RasterCalculator_sa". There is no description about that.&lt;/P&gt;&lt;P&gt;Add validation checking to your geoprocessing call like in code below:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;string sIputRaster = @"C:\Support\ESRI_LocalGovernment.gdb\FiveMeterSurface";
string sRaterPath = @"C:\Support\Fill.tif";

var parameters = Geoprocessing.MakeValueArray(sIputRaster, 1, sRaterPath);

var cts = new CancellationTokenSource();
var results = await Geoprocessing.ExecuteToolAsync("Fill_sa", parameters, null, cts.Token,
(eventName, o) =&amp;gt;
{
            System.Diagnostics.Debug.WriteLine($@"GP event: {eventName}");
            if (eventName == "OnMessage")
            {
                IGPMessage gpMsg = o as IGPMessage;
                if (gpMsg != null)
                {
                    Logger.Info(gpMsg.Text);
                }
                else
                {
                    Logger.Info($@"{o.ToString()}");
                }
            }
            if (eventName == "OnValidate")
            {
                List&amp;lt;IGPMessage&amp;gt; gpMsgs = (o as IGPMessage[]).ToList();
                if (gpMsgs != null)
                {
                    foreach (var gpMsg in gpMsgs)
                    {
                        if (gpMsg.ErrorCode == 0)
                        {
                            continue;
                        }

                        // Fill with your logging
                    }
                }
                else
                {
                    // Fill with your logging
                }
            }
            if (eventName == "OnProgressMessage")
            {
                // Fill with your logging
            }

}, GPExecuteToolFlags.None);
if (results.IsFailed)
{
   MessageBox.Show("Failed to create fill layer. Error " + results.ErrorCode);

return;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 12:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301455#M9952</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-06-21T12:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Call ArcHydro tools using ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301557#M9955</link>
      <description>&lt;P&gt;Thanks a lot for your help.&amp;nbsp; I am able to get it work now.&amp;nbsp; The key is the GP tool name.&amp;nbsp; It should be "Fill_sa" as you indicated.&amp;nbsp; But it only takes 2 parameters in Pro SDK though.&amp;nbsp; It would be better if users can specify z_limit.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 15:31:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301557#M9955</guid>
      <dc:creator>AquanuityDevelopment</dc:creator>
      <dc:date>2023-06-21T15:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Call ArcHydro tools using ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301694#M9956</link>
      <description>&lt;P&gt;Try to specify z_limit as third parameter. Sometimes spatial analyst tools inserts output parameter in second or in third position. So if you have found that output parameter is second then z_limit parameter could be third&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 18:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/call-archydro-tools-using-arcgis-pro-sdk/m-p/1301694#M9956</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-06-21T18:29:56Z</dc:date>
    </item>
  </channel>
</rss>

