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

IGPFunction2.Execute() never triggers when using IEnumLayer.Next()

$
0
0
Hello,

I got an issue in a custom GP tool I don't really understand:

In my UpdateMessages() method, I use the following code to run through all layers:

Code:

IEnumLayer enumLayer = gpUtils.GetMapLayers();
enumLayer.Reset();
ILayer layer = enumLayer.Next();
while (layer != null)
{
    <code here>
    layer = enumLayer.Next();
}

The purpose is to look for layers with duplicate names.

This works fine when I don't run the tool in the background. In background mode however, the Execute() method is never
triggered.

This seems to happen after enumLayer.Next(). When commenting away the enumLayer.Next() and the code below, it works again.

There are no error messages or exceptions occuring, and Arc claims that the tool executed succesfully.
When calling IGPMessages.AddMessage() as the first action in Exceute(), nothing is yielded.

Am I missing something here ?


Oyvind

Viewing all articles
Browse latest Browse all 1374

Trending Articles