<?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: Error running geoprocessing tool &amp;quot;management.createfeatureclass&amp;quot; in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/error-running-geoprocessing-tool-quot-management/m-p/1580531#M12561</link>
    <description>&lt;P&gt;The problem was invalid featureclass name with number at the beginning and space. With the code sample shared by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;, I was able to se the error message. Thank you&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;</description>
    <pubDate>Thu, 30 Jan 2025 17:58:14 GMT</pubDate>
    <dc:creator>zhangjinzhou</dc:creator>
    <dc:date>2025-01-30T17:58:14Z</dc:date>
    <item>
      <title>Error running geoprocessing tool "management.createfeatureclass"</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/error-running-geoprocessing-tool-quot-management/m-p/1578743#M12528</link>
      <description>&lt;P&gt;I am trying to create an empty feature class in a file geodatabase, but it's not working. The geoprocessing tool doesn't provide a specific error message. When I run the tool on a folder, it creates an empty shapefile without any issues. Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;string path = analysis.Path + "\\CVAnalysis.gdb"; // This doesn't work. The CVAnalysis.gdb exists, and I have no problem creating a feature class when running the geoprocessing tool manually in ArcGIS Pro.
string path = analysis.Path; // This works and output a shapefile.
var parameters = Geoprocessing.MakeValueArray(
        path,
        "NewLayer",
        "Polygon"
);
string toolName = "management.CreateFeatureclass";
var result = await Geoprocessing.ExecuteToolAsync(toolName, parameters, null, null, null);
if (result.IsFailed)
{
    foreach (var message in result.Messages)
    {
        MessageBox.Show(message.Text); // There is no message in the error
    }
}
else
{
    System.Diagnostics.Debug.WriteLine("Feature class created successfully.");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 17:18:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/error-running-geoprocessing-tool-quot-management/m-p/1578743#M12528</guid>
      <dc:creator>zhangjinzhou</dc:creator>
      <dc:date>2025-01-24T17:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error running geoprocessing tool "management.createfeatureclass"</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/error-running-geoprocessing-tool-quot-management/m-p/1578916#M12531</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Your code works fine. There are some reasons why you can't create featureclass within geodatabase:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;analysis.Path ends with "\".&amp;nbsp; I would recommend to use &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.io.path.combine?view=net-9.0" target="_self"&gt;Path.Combine&lt;/A&gt; method to construct full path.&lt;/P&gt;&lt;P&gt;2. Your geodatabase already contains&amp;nbsp;"NewLayer" featureclass.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would recommend to use&amp;nbsp;ExecuteToolAsync method&amp;nbsp;&amp;nbsp;with GPToolExecuteEventHandler parameter as in API reference &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9384.html" target="_self"&gt;sample&lt;/A&gt;. It will show issues with input parameters.&lt;/P&gt;&lt;LI-CODE lang="csharp"&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))
            _cts.Cancel();
          break;

        case "OnProgressMessage":
          string msg = string.Format("{0}: {1}", new object[] { event_name, (string)o });
          System.Windows.MessageBox.Show(msg);
          _cts.Cancel();
          break;

        case "OnProgressPos":
          string msg2 = string.Format("{0}: {1} %", new object[] { event_name, (int)o });
          System.Windows.MessageBox.Show(msg2);
          _cts.Cancel();
          break;
      }
    });

var ret = result;
_cts = null;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jan 2025 19:18:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/error-running-geoprocessing-tool-quot-management/m-p/1578916#M12531</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2025-01-25T19:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error running geoprocessing tool "management.createfeatureclass"</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/error-running-geoprocessing-tool-quot-management/m-p/1580531#M12561</link>
      <description>&lt;P&gt;The problem was invalid featureclass name with number at the beginning and space. With the code sample shared by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;, I was able to se the error message. Thank you&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;</description>
      <pubDate>Thu, 30 Jan 2025 17:58:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/error-running-geoprocessing-tool-quot-management/m-p/1580531#M12561</guid>
      <dc:creator>zhangjinzhou</dc:creator>
      <dc:date>2025-01-30T17:58:14Z</dc:date>
    </item>
  </channel>
</rss>

