var options
= new PromptSelectionOptions
(){ MessageForAdding
= "\nSelect Polylines" }; var filter
= new SelectionFilter
(new[] { new TypedValue
(0,
"LWPOLYLINE") }); var selection = ed.GetSelection(options, filter);
if (selection.Status == PromptStatus.OK)
{
ObjectId[] ids;
using (var tr
= new OpenCloseTransaction
()) {
ids = selection.Value.GetObjectIds()
.Select(id => (Polyline)tr.GetObject(id, OpenMode.ForRead))
.Where(pl => IsSquare(pl))
.Select(pl => pl.ObjectId)
.ToArray();
tr.Commit();
}
ed.SetImpliedSelection(ids);
}