创建一个SegmentCollection对象,将Line作为Segment放进去,再将SegmentCollection转为Polyline即可。
代码如下:
/// <summary>
/// Line转Polyline
/// </summary>
/// <param name="pLine">要转换的Line</param>
/// <returns>转换结果Polyline</returns>
static public IPolyline LineToPolyline(ILine pLine)
{
ISegmentCollection pSegCol = new PolylineClass();
pSegCol.AddSegment(pLine as ISegment);
return pSegCol as IPolyline;
}
本文介绍了一种将Line对象转换为Polyline对象的方法。通过创建一个SegmentCollection对象,并将Line作为Segment添加进去,最终可以成功将Line转换为Polyline。
853

被折叠的 条评论
为什么被折叠?



