That's usually what we prefer happen (the screen is not updated until all of many objects are created).
If you need to see the objects as they're being added to the database, try using the FlushGraphics() and EnableGraphicsFlush() methods of the Document's TransactionManager, and the Editor's UpdateScreen() method.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com
Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm
wrote in message news:6008899@discussion.autodesk.com...
Hi there,
in my application I am drawing several thousands of objects following this scheme:
Line^ linie = gcnew Line();
Database^ dwg = HostApplicationServices::WorkingDatabase;
TransactionManager^ tm = dwg->TransactionManager;
Transaction^ ta = tm->StartTransaction();
try
{
linie->StartPoint = Point3d(xVon, yVon, 0.0);
linie->EndPoint = Point3d(xNach, yNach, 0.0);
linie->Layer = layer;
BlockTable^ bt = (BlockTable^)tm->GetObject(dwg->BlockTableId, OpenMode::ForRead);
BlockTableRecord^ modelSpace =
(BlockTableRecord^)tm->GetObject(bt[BlockTableRecord::ModelSpace], OpenMode::ForWrite);
modelSpace->AppendEntity(linie);
handle = linie->Handle.Value;
ta->AddNewlyCreatedDBObject(linie, true);
ta->Commit();
}
catch (Autodesk::AutoCAD::Runtime::Exception^ e)
{
ta->Abort();
return -1;
}
finally
{
delete ta;
}
But unfortunately the graphic's only being drawn at the end of my function, whereas I'd rather like to have it being drawn as the objects are being created. Any idea, how to accomplish that?
Another question is: what's the difference between TransactionManager::Commit() and Transaction::Commit() ?
At least in my code it doesn't change anything making this call or that.
Thanks in advance, Bernd