- [CommandMethod("t2", CommandFlags.UsePickSet)]
- public static void Test2()
- {
- var doc = Application.DocumentManager.MdiActiveDocument;
- var db = doc.Database;
- var ed = doc.Editor;
- var res1 = ed.SelectImplied();
- var res2 = ed.SelectAll(
- new ResultList
- {
- {DxfCode.Color, 5},
- {DxfCode.Start, "CIRCLE"},
- {DxfCode.LayerName, "0"}
- });
- var ids = res1.Value.GetObjectIds().Intersect(res2.Value.GetObjectIds());
- using (var tr = db.TransactionManager.StartTransaction())
- {
- foreach (var id in ids)
- {
- var cir = tr.GetObject(id, OpenMode.ForWrite) as Circle;
- cir.ColorIndex = 2;
- }
- tr.Commit();
- }
- }
|