AnsweredAssumed Answered

arcobjects run "intersect" gp tool, get "Object reference not set to an instance of an object" error

Question asked by littleleaf on Oct 13, 2014
Latest reply on Oct 16, 2014 by littleleaf

Dear all,

 

I am using vb.net arcobjects to run "intersect" GeoProcessing tool, but get "Object reference not set to an instance of an object" error.

 

My code is as follows:

 

            Dim objGP As IGeoProcessor = New GeoProcessor

            Dim InputLayer = "dev_db.DBO.Segment;dev_db.DBO.LINE_1"

            Dim output = "D:\dev\Seg_line_intersect"

 

            objGP.OverwriteOutput = True

            Dim objParameters = New VarArray

            objParameters.Add(InputLayer)

            objParameters.Add(output)

 

            Dim objResult As IGeoProcessorResult = objGP.Execute("Intersect_Analysis", objParameters, Nothing)

 

The error is:

gperrrrrrrrrrrrrrrrr.jpg

There are selected features in the segment layer.

 

I am using arcmap 10.2.2.

 

I failed to find what's wrong with my code, please kindly advice on it, thanks a lot.

Outcomes