<?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: How to get error messages in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-error-messages/m-p/1372800#M11017</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It could show that your tool was not started for not valid parameters or invalid tool path/name. Try to use&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9384.html" target="_self"&gt;GPTool Execute Event Handler&lt;/A&gt; to get more information about tool execution.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;System.Threading.CancellationTokenSource _cts;

string ozone_points = @"C:\data\ca_ozone.gdb\O3_Sep06_3pm";

string[] args = { ozone_points, "OZONE", "", "in_memory\\raster", "300",
                    "EMPIRICAL", "300", "5", "5000",
                    "NBRTYPE=StandardCircular RADIUS=310833.272442914 ANGLE=0 NBR_MAX=10 SECTOR_TYPE=ONE_SECTOR",
                    "PREDICTION", "0.5", "EXCEED", "", "K_BESSEL" };

string tool_path = "ga.EmpiricalBayesianKriging";

_cts = new System.Threading.CancellationTokenSource();

var result = await Geoprocessing.ExecuteToolAsync(tool_path, args, null, _cts.Token,
    (event_name, o) =&amp;gt;  // implement delegate and handle events
    {
        switch (event_name)
        {
            case "OnValidate": // stop execute if any warnings
                if ((o as IGPMessage[]).Any(it =&amp;gt; it.Type == GPMessageType.Warning))
                break;

            case "OnProgressMessage":
                string msg = string.Format("{0}: {1}", new object[] { event_name, (string)o });
                System.Windows.MessageBox.Show(msg);
                break;

            case "OnProgressPos":
                string msg2 = string.Format("{0}: {1} %", new object[] { event_name, (int)o });
                System.Windows.MessageBox.Show(msg2);
                break;
        }
    });

var ret = result;
_cts = null;&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 22 Jan 2024 06:41:10 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2024-01-22T06:41:10Z</dc:date>
    <item>
      <title>How to get error messages</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-error-messages/m-p/1372778#M11015</link>
      <description>&lt;P&gt;I am using arcgis pro sdk. After I called the tool, the tool failed to run, but the prompt box was blank. How can I get detailed information?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YetaoYang_0-1705890956912.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92344i1B4855CCA8136D3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YetaoYang_0-1705890956912.png" alt="YetaoYang_0-1705890956912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// 获取错误信息
if (results.IsFailed)
{
    await QueuedTask.Run(() =&amp;gt;
    {
        Geoprocessing.ShowMessageBox(results.Messages, "工具执行失败", GPMessageBoxStyle.Error);
    });
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Jan 2024 02:36:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-error-messages/m-p/1372778#M11015</guid>
      <dc:creator>YetaoYang</dc:creator>
      <dc:date>2024-01-22T02:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get error messages</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-error-messages/m-p/1372800#M11017</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It could show that your tool was not started for not valid parameters or invalid tool path/name. Try to use&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9384.html" target="_self"&gt;GPTool Execute Event Handler&lt;/A&gt; to get more information about tool execution.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;System.Threading.CancellationTokenSource _cts;

string ozone_points = @"C:\data\ca_ozone.gdb\O3_Sep06_3pm";

string[] args = { ozone_points, "OZONE", "", "in_memory\\raster", "300",
                    "EMPIRICAL", "300", "5", "5000",
                    "NBRTYPE=StandardCircular RADIUS=310833.272442914 ANGLE=0 NBR_MAX=10 SECTOR_TYPE=ONE_SECTOR",
                    "PREDICTION", "0.5", "EXCEED", "", "K_BESSEL" };

string tool_path = "ga.EmpiricalBayesianKriging";

_cts = new System.Threading.CancellationTokenSource();

var result = await Geoprocessing.ExecuteToolAsync(tool_path, args, null, _cts.Token,
    (event_name, o) =&amp;gt;  // implement delegate and handle events
    {
        switch (event_name)
        {
            case "OnValidate": // stop execute if any warnings
                if ((o as IGPMessage[]).Any(it =&amp;gt; it.Type == GPMessageType.Warning))
                break;

            case "OnProgressMessage":
                string msg = string.Format("{0}: {1}", new object[] { event_name, (string)o });
                System.Windows.MessageBox.Show(msg);
                break;

            case "OnProgressPos":
                string msg2 = string.Format("{0}: {1} %", new object[] { event_name, (int)o });
                System.Windows.MessageBox.Show(msg2);
                break;
        }
    });

var ret = result;
_cts = null;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Jan 2024 06:41:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-error-messages/m-p/1372800#M11017</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2024-01-22T06:41:10Z</dc:date>
    </item>
  </channel>
</rss>

