kbunzel3

Running a geoprocessing tool using background geoprocessing with custom tool

Discussion created by kbunzel3 on Apr 4, 2012
Latest reply on Apr 18, 2012 by kbunzel3
Hello,
I am trying to run a custom python script from an ArcMap toolbar and display messages created in the python script to the user in the ArcMap interface.  I am using ArcGIS 10 and the sample for this at http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001z2000000.htm.  The sample works after I copied the sample data from my ArcGIS install folder to the same folder as the sample and modified the path to the data in the sample code.

After I added my own custom toolbox/tool through _gp.AddToolbox(toolboxPath) and started the process with _gp.ExecuteAsync("TestScript", parameters), my custom tool also ran fine.  However, my problem is I can't figure out how to get it to display messages from the python script to the user.  The MessagesCreated event is not triggered from python code such as gp.AddMessage("test") or arcpy.AddMessage("test").  The sample only runs built in ArcToolbox tools such as clip and buffer with no associated python script that I can examine.  I'm wondering what needs to be done inside the python script to trigger the MessagesCreated event so I can display those message to the user?
Thanks,
Ken

Outcomes