AnsweredAssumed Answered

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

Question asked by kyanuk1 on Feb 11, 2013
Latest reply on Feb 11, 2013 by kyanuk1
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:
            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

Outcomes