I am trying to rerun a script that I ran previously successfully, but now, I keep getting the error, "The function evaluated requires all thread to run" at the "management.AddIndex" method. There is probably a better way of writing the geoprocessing methods below, but I am relatively new at creating Add-In using the ArcGIS Pro SDK v2.8. Please see the script below:
var args2 = Geoprocessing.MakeValueArray(filePath, outGDB, fieldTable);
GPRun("conversion.TableToTable", args2);
//Create index to the field table - Error occurs here
var ipara = Geoprocessing.MakeValueArray(fieldTable, "mukey", "tableIndex");
GPRun("management.AddIndex", ipara);
public async void GPRun(string GPTool, IReadOnlyList<string> parameters)
{
var gp_result = await Geoprocessing.ExecuteToolAsync(GPTool, parameters);
if (gp_result.IsFailed)
{
if (gp_result.Messages.Count() != 0)
{
Geoprocessing.ShowMessageBox(gp_result.Messages, "GP Messages", gp_result.IsFailed ? GPMessageBoxStyle.Error : GPMessageBoxStyle.Default);
}
else
{
MessageBox.Show("Error in running the Geoprocessing Tool: " + GPTool + ", please check parameters.", "Geoprocessing Error");
}
}
}
Thanks for your help!