查看单个帖子
旧 2009-05-05, 09:03 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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();
}
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)