Select to view content in your preferred language

vb.net arcobjects run "Summary Statistics" GeoProcessing tool

2568
5
Jump to solution
09-18-2014 02:01 AM
LiYao
by
Deactivated User

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:

mapsummary.jpg

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)

0 Kudos
1 Solution

Accepted Solutions
ShriramBhutada1
Deactivated User

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());

View solution in original post

0 Kudos
5 Replies
LiYao
by
Deactivated User

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!

0 Kudos
ShriramBhutada1
Deactivated User

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)

0 Kudos
LiYao
by
Deactivated User

Hi Shriram,

Thank you very much for the reply. But it still not work.

0 Kudos
ShriramBhutada1
Deactivated User

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());

0 Kudos
LiYao
by
Deactivated User

Hi Shriram,

Thank ypu very much for the patient and help.

0 Kudos