Select to view content in your preferred language

Hide statusbar messages when geoprocessing

542
4
03-11-2020 03:14 PM
AbelPerez
Frequent Contributor

Using ArcObjects and VB.NET I have a routine that does several geoprocessing functions. These processes are built by ESRI to send messages to the ArcMap statusbar. That seems to over-ride my custom messages and progressbar. Is there a way to supress the geoprocessing messages sent to the statusbar?

0 Kudos
4 Replies
DuncanHornby
MVP Notable Contributor

I don't experience the issues you are describing.

Which geo-processing tools are you calling and how are you calling them? Some example code would help...

At the moment you have asked a very general question, showing us nothing, no one is going to be able to answer this question...

0 Kudos
AbelPerez
Frequent Contributor

Any gp really. I see it quite a bit on Clip. So code looks like:

'initialize the geoprocessor.
Dim GP As GeoProcessor = New GeoProcessor
GP.AddOutputsToMap = False 

'create an IVariantArray to hold the parameter values.
Dim parameters As IVariantArray = New VarArray

parameters.Add(inSurfaceFullName) 'input surface
parameters.Add("") '

parameters.Add(outClippedRasterFullName)
parameters.Add(inClippingPolyFullName)
parameters.Add("") 
parameters.Add("ClippingGeometry") 
parameters.Add("NO_MAINTAIN_EXTENT") 

'execute the model tool by name.
Dim res As IGeoProcessorResult = GP.Execute("Clip_management", parameters, Nothing)

As this is processing the output messages get sent to the status bar and seem to overwrite what I wrote there manually.

0 Kudos
DuncanHornby
MVP Notable Contributor

Interesting, that is how I tend to call geo-processing tools in ArcObjects although I would set up the GeoProcessor as:

Dim pgp as IGeoProcessor
pgp = new GeoProcessor

I don't get any of the messages on the statusbar.

0 Kudos
AbelPerez
Frequent Contributor

If I set a status message before I run the gp tool

 MyApp.StatusBar.Message(0) = "Clipping raster with " & inClippingPolyFullName & "..."

Then after the gp tool finishes it has cleared my message. Most times its ok but I am running some loops and its useful for the user to see what is happening.

I see what you are saying about setting up the gp object. However, every sample on the ESRI site Ive seen shows it as I have posted ArcObjects 10 .NET SDK Help . Not sure what the difference is though.

0 Kudos