用.NET API实现亮显POLYLINE子段
下面C#代码提示用户选择多段线,然后输入要亮显的字段的编号,亮显一个子段。public static void HighlightPolySeg()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
PromptEntityOptions peo = new PromptEntityOptions("\nSelect a polyline: ");
peo.SetRejectMessage("\nMust be a polyline...");
peo.AddAllowedClass(typeof(Polyline), true);
PromptEntityResult per = ed.GetEntity(peo);
if (per.Status != PromptStatus.OK) return;
using (Transaction Tx = db.TransactionManager.StartTransaction())
{
Polyline polyline = Tx.GetObject(per.ObjectId, OpenMode.ForRead) as
Polyline;
int nbSegments = polyline.NumberOfVertices;
if (!polyline.Closed) --nbSegments;
PromptIntegerOptions pio = new PromptIntegerOptions("\nEnter segment id
:");
pio.LowerLimit = 1;
pio.UpperLimit = nbSegments;
PromptIntegerResult pir = ed.GetInteger(pio);
if (pir.Status != PromptStatus.OK) return;
FullSubentityPath path = new FullSubentityPath(new ObjectId[] {
polyline.Id }, new SubentityId(SubentityType.Edge, pir.Value));
polyline.Highlight(path, true);
}
}
别只看,你有好东西也分享哦!
学习学习,谢谢
楼主有没有清理pl线重复点的办法? 啥也不说了,感谢楼主分享哇!
学习学习。。。
正需要,支持楼主大人了! 都是高科技,所以必须要回复
啥也不说了,感谢楼主分享哇! 学习!!!!!!!!!!!!!!
学习学习!
高亮显示,要是能显示夹点就更好了
xx看看学习学习
学习一下{:1_12:}{:1_12:}{:1_12:}{:1_12:}{:1_12:} 感谢楼主分享!
感谢分享!好好学习天天向上