I am coding a VB.net console application using ArcObjects to call ArcGIS 10.1 geoprocessing tools. I have several geoprocessing calls that actually work, but that pop up an irritating message box when I call them from code. This is a problem because I need to run my application in batch at the command line and this message box pauses the application while it waits for input.
The message box appears consistently on certain geoprocessing calls, but not for all calls. The two main culprits are "Calculate Field" and "Raster Calculator". Below is an example of the former:
Dim GP As New Geoprocessor Dim CalcFieldTool As New CalculateField CalcFieldTool.in_table = pFClass CalcFieldTool.field = "Elevation" CalcFieldTool.expression = "!RASTERVALU!" CalcFieldTool.expression_type = "PYTHON" CalcFieldTool.code_block = " " GP.Execute(CalcFieldTool, Nothing)
The messages does NOT appear if I use VBA syntax for the calls instead of Python. However, my application has to run against ArcGIS Server which does not (and cannot) include VBA, and so I am tied to Python Syntax. Also, the message box does not appear when I run the same geoprocessing tools in ArcGIS Desktop.
This code works and the Elevation field is indeed updated with the values from the RASTERVALU field. I am just need to avoid the message box popping up. Also note that this is well tested code and used to work without the popup until recently... perhaps ArcGIS 10.1 service pack 1. (I cannot upgrade to 10.2.)
I am now almost certain that this is related to an architecture mis-match somewhere. My computer is 64 bit, ArcGIS is 32 bit, my console application is compiled as 32 bit (not Any CPU) and I have both the original 32 bit version of Python installed as well as the ArcGIS 10.1 Service Pack 1 64 bit background geoprocessing download installed. But I am unsure how to direct my code to use the latter.