求大神帮忙polyline顶点问题
我想对polyline进行操作,目的是重新绘制polyline。给一个长度为n的Point3dCollection,polyline的顶点个数为l,当n>l时,增加polyline的顶点并重画,当n<l时,移除polyline顶点并重画。求大神指点错误,或是提供更好办法,感激不尽啊!!!!!!if (t.GetObject(id, OpenMode.ForWrite) as Polyline != null)
{
Polyline po = t.GetObject(id,OpenMode.ForWrite ) as Polyline;
int l = po.NumberOfVertices;
double bul = po.GetBulgeAt(1);
double str = po.GetStartWidthAt(1);
double end = po.GetEndWidthAt(1);
for (int i = 0; i < l; i++)
{
if (i < n)
{
Point2d p = new Point2d(arr.X, arr.Y);
po.SetPointAt(i, p);
}
else
{
po.RemoveVertexAt(i);
}
}
for (int i = l - 1; i < n; i++)
{
Point2d p = new Point2d(arr.X, arr.Y);
po.AddVertexAt(i, p, bul, str, end);
}
}
t.Commit();
页:
[1]