cad二开中提交事务前可动态显示实体图形,方法如下:
主代码:
public static void Redraw(this Editor ed, Entity? ent = null)
{
using (ent?.ForWrite())
{
ent?.Redraw(BrightEntity.RecordGraphicsModified | BrightEntity.RecomputeDimensionBlock | BrightEntity.Draw | BrightEntity.MoveZero);
ed.Redraw(BrightEditor.UpdateScreen);
}
Autodesk.AutoCAD.ApplicationServices.TransactionManager transactionManager = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument.TransactionManager;
transactionManager.QueueForGraphicsFlush();
transactionManager.FlushGraphics();
//Application.DoEvents();//目前不可用
}
public static void Redraw(this Editor ed, BrightEditor bright)
{
if ((bright & BrightEditor.UpdateScreen) == BrightEditor.UpdateScreen)