linq语句在CAD c# 二次开发中的应用——快速筛选curve中polyline
linq语句快速筛选curve中polyline
public void XX()
{
List<Curve> ents = Z.db.SelectEntities<Curve>();
if (ents == null || ents.Count == 0) return;
List<Curve> pl = ents.FindAll(x=>x is Polyline).Select(x=>x as Curve).ToList();
pl.ForEach(x => {
x.ChangeEntityColor(1);
x.Highlight();
});
Z.ed.WriteMessage($"共有{pl.Count}个pl\n");
}
效果如下: