几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】enabling fast zooms in dwg c== win32 (http://www.dimcax.com/hust/showthread.php?t=16049)

yang686526 2009-05-05 09:03 AM

【转帖】enabling fast zooms in dwg c== win32
 
enabling fast zooms in dwg c++ win32
enabling fast zooms in dwg c++ win32
after creating viewports in papespace & saving a dwg, viewres parameter
is set to <n>.
is possible to create a viewport with fast zooms\ viewres enabled?
the following code was used to create the viewport:
// create viewport
oddbviewportptr pvp = oddbviewport::createobject();
pps->appendoddbentity(pvp);
pvp->setlayer(viewportlayerid);
pvp->setunlocked(); // enables viewport pan & zoom
pvp->setfastzoomon(); // enables viewport pan & zoom
pvp->setcenterpoint(centerpoint);
pvp->setwidth(dwidth);
pvp->setheight(dheight);
is more more code required? i though the following line would have fixed the problem.
pvp->setfastzoomon(); // enables viewport pan & zoom
i found a fix for the problem:
the following code is called before the drawing is saved as r14 dwg file:
m_pdb->settilemode(0); // 0 for paperspace
oddbblocktablerecordptr pblcltblrec = m_pdb->getactivelayoutbtrid().safeopenobject();
oddblayoutptr playout = pblcltblrec->getlayoutid().safeopenobject();
oddbobjectid actid = playout->lastactivevportid();
if (actid)
{
oddbviewportptr pvp = actid.safeopenobject(oddb::kforwrite);
pvp->setfastzoomon();
}


所有的时间均为北京时间。 现在的时间是 06:14 AM.