QueueForGraphicsFlush not working (.NET API)
Comments
-
I found a workaround using Entity.Draw() instead.
Here's a little example:
[CommandMethod("TEST")] public static void Test() { var doc = Application.DocumentManager.MdiActiveDocument; var db = doc.Database; var ed = doc.Editor; var ppo = new PromptPointOptions("\nCenter: ") { AllowNone = true }; using (var tr = db.TransactionManager.StartTransaction()) { var space = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite); PromptStatus status; do { var ppr = ed.GetPoint(ppo); status = ppr.Status; switch (status) { case PromptStatus.Cancel: return; case PromptStatus.OK: var circle = new Circle() { Center = ppr.Value, Radius = 10.0 }; circle.TransformBy(ed.CurrentUserCoordinateSystem); space.AppendEntity(circle); tr.AddNewlyCreatedDBObject(circle, true); // QueueForGraphicsFlush() does not seems to work with BricsCAD, // use Entity.Draw() instead //db.TransactionManager.QueueForGraphicsFlush(); circle.Draw(); break; default: break; } } while (status == PromptStatus.OK); tr.Commit(); } }
0