How to Get intersect Point in ArcObject

 
 
 
public IPoint getInsertionPnt(IPolyline pl_cbl, IFeature sub)
{
   IPoint pnt = null;
   try
   {
      ITopologicalOperator pTopo = pl_cbl as ITopologicalOperator;
      IPointCollection pPoints;
      IGeometry pGeom = pTopo.Intersect(sub.Shape,
     
esriGeometryDimension.esriGeometry0Dimension);
      if (pGeom == null)
        return pnt;
      else if (pGeom.GeometryType ==
      esriGeometryType.esriGeometryMultipoint)
      {
         pPoints = pGeom as IPointCollection;
         if (pPoints.PointCount == 1)
         pnt = pPoints.get_Point(0);
      else
      return pnt;
    }
}
   catch (Exception ex)
   {
     MessageBox.Show(ex.Message);
   }
   return pnt;
}
Ebook Download
View all
Learn
View all