Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a problem when i execute GeoProcessing in ArcEngine 10 with VB.net

i had create the toolbox : Models.tbx and Model Process : disolveRoute with 2 parameters

enter image description here

My Function is :

  Sub diso()
    Dim dissolveTable As ITable = CType(featureLayerRoute, ITable)
    Dim gp As GeoProcessor = New ESRI.ArcGIS.Geoprocessing.GeoProcessor()
    Dim trac As ITrackCancel = New CancelTracker
    Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
    Dim parameters As IVariantArray = New VarArrayClass()

    gp.SetEnvironmentValue("workspace", "Database Connections\IFE connexion.sde")
    gp.OverwriteOutput = True
    gp.AddToolbox("data\Models.tbx")

    parameters.Add(dissolveTable)
    parameters.Add("typeroute")

    Try
        Result = CType(gp.Execute("disolveRoute", parameters, trac), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2)
    Catch ex As Exception
        Dim sev As Object = 2
        Dim messages As String = gp.GetMessages(sev)
        System.Console.WriteLine(messages)
    End Try

End Sub

For the inpute feature for disolve --> featureLayerRoute :

 Dim Sp As IWorkspace = ConnectToTransactionalVersion("localhost", "sde:postgresql:localhost", "sde", "....", "....")
dim featureLayerRoute As IFeatureLayer = New FeatureLayerClass
        featureLayerRoute.FeatureClass = featureWorkspace.OpenFeatureClass("piste_route")
        Dim layerrouteAs ILayer = featureLayerDroit
        layerroute.Name = featureLayerRoute.FeatureClass.AliasName

but when i execute this function it returned an ERROR

I Got this ERROR : Failed to execute. Parameters are not valid. ERROR 000840: The value is not a Feature Class. Failed to execute (disolveRoute).

please SomeOne Can Help !!

share|improve this question
1  
Why are you passing Nothing parameter for gp.Execute method? –  Darksanta Apr 17 '13 at 15:31
    
I agree with Darksanta, your execute method is incorrect, look here for correct syntax - edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriGeoProcessing/… –  Hornbydd Apr 17 '13 at 15:41
    
Sorry is not nothing is Parameters –  AbdelMounaim TAOUSSI Apr 17 '13 at 16:16
    
So any suggestion for this error ? : Failed to execute. Parameters are not valid. ERROR 000840: The value is not a Feature Class. Failed to execute (disolveRoute). –  AbdelMounaim TAOUSSI Apr 18 '13 at 11:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.