Hello all,
I am now trying to use vb.net to run "Summary Statistics" GeoProcessing tool. The corresponding parameters in the "Summary Statistics" GeoProcessing is as follows:
The vb.net code:
Dim GP As GeoProcessor = New GeoProcessor()
Dim parameters As IVariantArray = New VarArray
parameters.Add("geri_db.DBO.BQ_Segment_1")
parameters.Add("C:\Users\lyao\Documents\ArcGIS\Default.gdb\BQ_Segment_1_Statistics1")
parameters.Add("geri_db.DBO.BQ_Segment_1.OBJECTID")
parameters.Add("MAX")
GP.Execute("Summary_Statistics_analysis", parameters, Nothing)
Solved! Go to Solution.
Hi Li,
Yeah there was small error. Following code work. I've tested in on my computer.
Hope this is helpful.
Thanks,
Shriram
Program
private IGeoProcessorResult2 gpr = null;
static void Main(string[] args)
RuntimeManager.Bind(ProductCode.Desktop);
GeoProcessor gp =new GeoProcessor();
IVariantArray parameters = new VarArrayClass();
@"C:\junk\122.mdb\test");
@"C:\\Users\\shri7493\\Documents\\ArcGIS\\Default.gdb\\TBL_HYDRANT_Statistics");
"OBJECTID MAX");
IGeoProcessorResult gpResult = gp.Execute("Statistics_analysis", parameters, null);
for (int i = 0; i < gpResult.MessageCount; i++)
Console.Write (gpResult.GetMessage(i).ToString());
Don't know why part of the contents not displayed.
I want to know:
(1) is there any parameters missed in vb.net code?
(2) The sample from ESRI uses buffer GP:
gp.Execute("Buffer_analysis", parameters, Nothing)
But I use summary statistics_analysis, Summary_Statistics_analysis, Summary Statistics_analysis, SummaryStatistics_analysis, all of them not work.
Can please advise me on it? thanks a lot!
Hi Li,
Try following code and see if it works.
Dim GP As GeoProcessor = New GeoProcessor()
Dim parameters As IVariantArray = New VarArray
parameters.Add("geri_db.DBO.BQ_Segment_1")
parameters.Add("C:\Users\lyao\Documents\ArcGIS\Default.gdb\BQ_Segment_1_Statistics1")
parameters.Add("geri_db.DBO.BQ_Segment_1.OBJECTID MAX")
GP.Execute("Summary_Statistics_analysis", parameters, Nothing)
Hi Shriram,
Thank you very much for the reply. But it still not work.
Hi Li,
Yeah there was small error. Following code work. I've tested in on my computer.
Hope this is helpful.
Thanks,
Shriram
Program
private IGeoProcessorResult2 gpr = null;
static void Main(string[] args)
RuntimeManager.Bind(ProductCode.Desktop);
GeoProcessor gp =new GeoProcessor();
IVariantArray parameters = new VarArrayClass();
@"C:\junk\122.mdb\test");
@"C:\\Users\\shri7493\\Documents\\ArcGIS\\Default.gdb\\TBL_HYDRANT_Statistics");
"OBJECTID MAX");
IGeoProcessorResult gpResult = gp.Execute("Statistics_analysis", parameters, null);
for (int i = 0; i < gpResult.MessageCount; i++)
Console.Write (gpResult.GetMessage(i).ToString());
Hi Shriram,
Thank ypu very much for the patient and help.