几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】how to read a new drawing (http://www.dimcax.com/hust/showthread.php?t=16741)

yang686526 2009-05-06 03:04 PM

【转帖】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


所有的时间均为北京时间。 现在的时间是 05:00 PM.