<?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 Problem with Intersect!... in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-intersect/m-p/739966#M19646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Howdy All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I'm running into a problem with the ITopologicalOperator.Intersect function. I am working with two features from the same geodatabase that are polylines. I am trying to find the point at which the two line intersect. I happen to know that the intersect by visually inspecting the corner. I'm sure there's some test that I should do before trying the Intersect function. I am getting a "COMException was unhandled by user code" error on the line I call the Intersect function. Here is the code, including the calling line to my function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
'Calling line here...
PointResult = GetIntersectionPoint(CenterlineToSplitFeature.ShapeCopy, IntersectingFeature.ShapeCopy)


'Function code here...
Function GetIntersectionPoint(Line1 As IGeometry, Line2 As IGeometry) As IPoint

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeom As IGeometry
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTopo As ITopologicalOperator

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTopo = Line1

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Here's the line in which I get the error...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGeom = pTopo.Intersect(Line2, esriGeometryDimension.esriGeometryNoDimension)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ppoints As IPointCollection
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ppoint As IPoint

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ppoints = pGeom

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ppoints.PointCount &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ppoint = ppoints.Point(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return ppoint
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The particular ErrorCode I get is: -2147220971&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any clues as to what I'm doing wrong, or better yet as to how I might fix this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;More particulars:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VB .Net - Visual Studio 2010&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcMap 10.x, sp 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Windows 7 - 32-bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a snapshot of the actual intesection: The lines dDO intersect, but not at any vertice on either line. Also both line do have "arc"/curve sections in themselves, if that has anything to do with it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]13182[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin Orcutt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GIS Developer/Consultant&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;City of Cincinnati - Cincinnati Area GIS (CAGIS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(513) 850-1335 (cell)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="mailto:&amp;quot;Kevin.Orcutt@cincinnati-oh.gov&amp;quot;" rel="nofollow noopener noreferrer" target="_blank"&gt;Kevin.Orcutt@cincinnati-oh.gov&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.cagis.org" rel="nofollow noopener noreferrer" target="_blank"&gt;www.cagis.org&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:29:59 GMT</pubDate>
    <dc:creator>KevinOrcutt</dc:creator>
    <dc:date>2021-12-12T07:29:59Z</dc:date>
    <item>
      <title>Problem with Intersect!...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-intersect/m-p/739966#M19646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Howdy All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I'm running into a problem with the ITopologicalOperator.Intersect function. I am working with two features from the same geodatabase that are polylines. I am trying to find the point at which the two line intersect. I happen to know that the intersect by visually inspecting the corner. I'm sure there's some test that I should do before trying the Intersect function. I am getting a "COMException was unhandled by user code" error on the line I call the Intersect function. Here is the code, including the calling line to my function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
'Calling line here...
PointResult = GetIntersectionPoint(CenterlineToSplitFeature.ShapeCopy, IntersectingFeature.ShapeCopy)


'Function code here...
Function GetIntersectionPoint(Line1 As IGeometry, Line2 As IGeometry) As IPoint

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeom As IGeometry
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTopo As ITopologicalOperator

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTopo = Line1

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Here's the line in which I get the error...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGeom = pTopo.Intersect(Line2, esriGeometryDimension.esriGeometryNoDimension)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ppoints As IPointCollection
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ppoint As IPoint

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ppoints = pGeom

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ppoints.PointCount &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ppoint = ppoints.Point(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return ppoint
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The particular ErrorCode I get is: -2147220971&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any clues as to what I'm doing wrong, or better yet as to how I might fix this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;More particulars:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VB .Net - Visual Studio 2010&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcMap 10.x, sp 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Windows 7 - 32-bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a snapshot of the actual intesection: The lines dDO intersect, but not at any vertice on either line. Also both line do have "arc"/curve sections in themselves, if that has anything to do with it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]13182[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin Orcutt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GIS Developer/Consultant&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;City of Cincinnati - Cincinnati Area GIS (CAGIS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(513) 850-1335 (cell)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="mailto:&amp;quot;Kevin.Orcutt@cincinnati-oh.gov&amp;quot;" rel="nofollow noopener noreferrer" target="_blank"&gt;Kevin.Orcutt@cincinnati-oh.gov&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.cagis.org" rel="nofollow noopener noreferrer" target="_blank"&gt;www.cagis.org&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:29:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-intersect/m-p/739966#M19646</guid>
      <dc:creator>KevinOrcutt</dc:creator>
      <dc:date>2021-12-12T07:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Intersect!...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-intersect/m-p/739967#M19647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://resources.esri.com/help/9.3/ArcGISengine/ArcObjects/esriGeometry/Share_a_line_segment.htm"&gt;http://resources.esri.com/help/9.3/ArcGISengine/ArcObjects/esriGeometry/Share_a_line_segment.htm&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/esriGeometryDimension_Constants/002m00000017000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/esriGeometryDimension_Constants/002m00000017000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 04:31:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-intersect/m-p/739967#M19647</guid>
      <dc:creator>JohnNelson3</dc:creator>
      <dc:date>2012-04-03T04:31:56Z</dc:date>
    </item>
  </channel>
</rss>

