<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic arcobjects run &amp;quot;intersect&amp;quot; gp tool, get &amp;quot;Object reference not set to an instance of an object&amp;quot; error in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-run-quot-intersect-quot-gp-tool-get/m-p/413148#M11104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using vb.net arcobjects to run "intersect" GeoProcessing tool, but get "Object reference not set to an instance of an object" error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objGP As IGeoProcessor = New GeoProcessor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim InputLayer = "dev_db.DBO.Segment;dev_db.DBO.LINE_1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim output = "D:\dev\Seg_line_intersect"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objGP.OverwriteOutput = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objParameters = New VarArray&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objParameters.Add(InputLayer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objParameters.Add(output)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objResult As IGeoProcessorResult = objGP.Execute("Intersect_Analysis", objParameters, Nothing)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error is:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="20968" alt="gperrrrrrrrrrrrrrrrr.jpg" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/20968_gperrrrrrrrrrrrrrrrr.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;There are selected features in the segment layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using arcmap 10.2.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I failed to find what's wrong with my code, please kindly advice on it, thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Oct 2014 06:55:54 GMT</pubDate>
    <dc:creator>LiYao</dc:creator>
    <dc:date>2014-10-14T06:55:54Z</dc:date>
    <item>
      <title>arcobjects run "intersect" gp tool, get "Object reference not set to an instance of an object" error</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-run-quot-intersect-quot-gp-tool-get/m-p/413148#M11104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using vb.net arcobjects to run "intersect" GeoProcessing tool, but get "Object reference not set to an instance of an object" error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objGP As IGeoProcessor = New GeoProcessor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim InputLayer = "dev_db.DBO.Segment;dev_db.DBO.LINE_1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim output = "D:\dev\Seg_line_intersect"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objGP.OverwriteOutput = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objParameters = New VarArray&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objParameters.Add(InputLayer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objParameters.Add(output)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objResult As IGeoProcessorResult = objGP.Execute("Intersect_Analysis", objParameters, Nothing)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error is:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="20968" alt="gperrrrrrrrrrrrrrrrr.jpg" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/20968_gperrrrrrrrrrrrrrrrr.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;There are selected features in the segment layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using arcmap 10.2.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I failed to find what's wrong with my code, please kindly advice on it, thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2014 06:55:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-run-quot-intersect-quot-gp-tool-get/m-p/413148#M11104</guid>
      <dc:creator>LiYao</dc:creator>
      <dc:date>2014-10-14T06:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: arcobjects run "intersect" gp tool, get "Object reference not set to an instance of an object" error</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-run-quot-intersect-quot-gp-tool-get/m-p/413149#M11105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;Hi Li Yao,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;First reason for this error would be the path for input layers. I see that you are using the layers from SDE, but not specifying the SDE properties or geodatabase location. So add the sde file location as the default workspace as follows:&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;objGP.SetEnvironmentValue("workspace", "C:\temp\SQLDirect.sde")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;Second reason would be the output path. If this is a geodatabase then the path should be "D:\dev.gdb\Seg_line_intersect". If this is a shapefile then the path should be "D:\dev\Seg_line_intersect.shp".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;Try this out and let me know if this helps. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;Thanks, &lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;Mohini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 20:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-run-quot-intersect-quot-gp-tool-get/m-p/413149#M11105</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-10-16T20:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: arcobjects run "intersect" gp tool, get "Object reference not set to an instance of an object" error</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-run-quot-intersect-quot-gp-tool-get/m-p/413150#M11106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohini,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply, I have already solved the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 00:46:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-run-quot-intersect-quot-gp-tool-get/m-p/413150#M11106</guid>
      <dc:creator>LiYao</dc:creator>
      <dc:date>2014-10-17T00:46:03Z</dc:date>
    </item>
  </channel>
</rss>

