高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】how to read a new drawing
how to read a new drawing
how to read a new drawing
i use this code to read one drawing file. with this code i can read one drawing completely. after this, the drawing was draw to my device.
int viewload(char *filename)
{
// assuming pdb is a oddbdatabaseptr defined
// if the pdb exist, we want to destroy it
if(!pdb.isnull())
{
// destroy the database if is existing
delete pdb;
pdb = null;
}
pdb = svcs->readfile(filename);
// set the database for the device.
pexdevice->setdatabase(settings->pdb);
// prepare the device to render the active layout in
// thisdatabase.
pdevice = oddbgsmanager::setupactivelayoutviews(pdevice, pexdevice);
pdevice->update();
return(0);
}
if i recall another time this function with another file or with the same file, the new file was reading, but the draw() was never called. can i find simple examples in c++ which explain how to read a new drawing without all the mfc or mdi stuff?
martin groleau
hypershell inc.
martin,
i suggest to call odgsbasedevice::eraseallviews() before setuplayoutviews(...) or setupactivelayoutviews(...). or to do it every time at the end of current drawing.
for instance, so:
pexdevice->eraseallviews();
pexdevice->setdatabase(settings->pdb);
pdevice = oddbgsmanager::setupactivelayoutviews(pdevice, pexdevice);
else you can look at dwf export code as sample of this doing.
misha kuzinets
|