C# +AO获取线段中点

来源:互联网 发布:python 静态属性 编辑:程序博客网 时间:2024/06/05 17:55
  1. public static IPoint getLineCenterPoint(IPolyline pPolyline)  
  2.    {  
  3.        double d = pPolyline.Length;  
  4.        IPoint pPoint = new PointClass();  
  5.        try  
  6.        {  
  7.            pPolyline.QueryPoint(esriSegmentExtension.esriNoExtension, d / 2false, pPoint);  
  8.   
  9.   
  10.            return pPoint;  
  11.   
  12.        }  
  13.        catch (Exception ex)  
  14.        {  
  15.            return null;  
  16.   
  17.        }  
  18.   
  19.    }  
0 0
原创粉丝点击