Hi - I'm making an ExecuteToolAsync call to CalculateGeometryAttributes tool using ArcGIS Pro SDK 3.0 and am getting a System.Linq.Enumerable.WhereListIterator<ArcGIS.Desktop.Core.Geoprocessing.IGPMessage error. I've based my call on the tool reference located here: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-geometry-attributes.htm
I believe the error is related to the geometry_property parameter [[Field, Property],...]
my code is here:
var progDlg = new ProgressDialog("Processing Areas", "Cancel", 100, true);
progDlg.Show();
var inputLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().First(l => l.Name.Equals(LayerNames.TempLAClip));
var toolName = "management.CalculateGeometryAttributes";//based on my GP tool cache
var fieldParams = new List<string>() { "Ft2", "AREA" };
var fieldParamList = new List<List<string>>();//this appears to be a list of lists (I also tried just using a list and got same error
fieldParamList.Add(fieldParams);
var units = "SQUARE_FEET_US";
var calcParams = await QueuedTask.Run(() =>
{
return Geoprocessing.MakeValueArray(
new object[] { inputLayer, fieldParamList, units });
});
IGPResult result = await Geoprocessing.ExecuteToolAsync(toolName, calcParams, null, new CancelableProgressorSource(progDlg).Progressor, GPExecuteToolFlags.Default);
if (result.IsCanceled)//fails or is canceled
{
_vm.StatusMessage = "Calculation Canceled";
return false;
}
else if (result.IsFailed)//get error message here
{
_vm.StatusMessage = "Calculation Failed";
return false;
}
else
{
return true;
} any suggestions of how to fix this error?
Thanks
Pete