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

Getting Automation Error on GP call to Erase.

$
0
0
Good Afternoon,
I am running across an issue with using the geoprocessor with Erase. I have used this style (below) many times, and with commands that require much more complex arguments. I can't see what I'm doing wrong. Any help or suggestions appreciated.

Code:

    Set pGP = CreateObject("esriGeoprocessing.GpDispatch.1")
    pGP.OverwriteOutput = 1
    If fso.FolderExists("C:\Program Files\ArcGIS") Then
        pGP.Toolbox = "C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\Analysis Tools.tbx"
    Else
        pGP.Toolbox = "C:\Program Files(x86)\ArcGIS\ArcToolbox\Toolboxes\Analysis Tools.tbx"
    End If
MsgBox "subErase - (In, Erase, Out) = " & vbNewLine & sInputLayer & vbNewLine & sEraseLayer & vbNewLine & sOutputLayer
    pGP.Erase_Analyses sInputLayer, sEraseLayer, sOutputLayer
    Set pGP = Nothing

It is failing at the call to the command. The msgbox shows that all three variables are set to valid paths. I ran the command in the command line interface, and no problem.

I'm testing on Win7 64, ArcGIS 9.3.1, ArcINFO license.

Thanks in advance for any assistance.

Take care,
Craig

Viewing all articles
Browse latest Browse all 1374

Trending Articles