- 积分
- 116
- 明经币
- 个
- 注册时间
- 2015-7-13
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我想对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(); |
|