高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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();
}
|