IPointCollection转线IPolyline:
IPolyline pl = new PolylineClass();
IPointCollection ptc = pl as IPointCollection;
object missing = Type.Missing;
for (int i = 0; i < num1; i++)
{
IPoint pt = autoStation.GetFeature(i).Shape as IPoint;//提取点
ptc.AddPoint(pt, missing, missing);
}
(pl as ITopologicalOperator).Simplify();
//把IPolyline插入到IFeatureClass中
IFeatureClass f1 = (ws as IFeatureWorkspace).OpenFeatureClass("bb1");
IFeature fea=f1.CreateFeature();
fea.Shape = pl;
fea.Store();
自己总结一下,省的每次用的时候还得翻箱倒柜。