Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Utilizing Python Models through add-in button (C#)

$
0
0
Hello,

I am trying to run a few GIS models (quite a few) through a button click and simple add-in form. I'd like to receive the messages sent back from the model into, say, a listbox or label.

this is my code thus far:
Code:

            IGeoProcessor2 gp = new GeoProcessorClass();
            gp.OverwriteOutput = true;

            gp.AddToolbox(@"C:\data\ADAmapping\ADA_Tools.tbx");

            IVariantArray parameters = new VarArrayClass();

            parameters.Add(date);
            parameters.Add(username);
            parameters.Add(quarterly);
            parameters.Add(monthly);
            parameters.Add(yearly);

            try
            {
                gp.Execute("SnapshotADAData", parameters, null);
                gp.GetMessages( ??? );  // WHAT IS THE PROPER USE HERE
            }
              [...]

Is this the proper way to retrieve the messages? (after the Execute function?)
What is the pSeverity object supposed to be?

Thank you,

Kevin

Viewing all articles
Browse latest Browse all 1374

Trending Articles