几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】entities in layouts are invisible (http://www.dimcax.com/hust/showthread.php?t=16059)

yang686526 2009-05-05 09:27 AM

【转帖】entities in layouts are invisible
 
entities in layouts are invisible
entities in layouts are invisible
hi!
i have a problem. use code below to put entities from model space of one drawing into layout of other drawing.
code:
oddbblocktablerecordptr presultspace;
oddbdictionaryptr playoutdict = pdb->getlayoutdictionaryid().safeopenobject();
oddbdictionaryiteratorptr piter = playoutdict->newiterator();

while (!piter->done())
{
oddblayoutptr presultlayout = piter->objectid().safeopenobject();
odstring strlayoutname = presultlayout->getlayoutname();
strlayoutname.makelower();
if ( strlayoutname == str_tmp.makelower())
{
str_tmp = tmp_listfiles.front().c_str();
presultspace = presultlayout->getblocktablerecordid().openobject(oddb::kforwrite);
db_tmp = m_svcs.readfile(str_tmp,false,false);
oddbobjectid idblk = layout->getblocktablerecordid();
oddbblocktablerecordptr pblk = idblk.openobject(oddb::kforwrite);
pdb->insert(pblk->getname(), db_tmp, false);
{
oddbobjectid actid = presultlayout->lastactivevportid();
if (actid)
{
oddbviewportptr pvp = actid.safeopenobject(oddb::kforwrite);
pvp->zoomextents();
}
}

break;
}//end if
presultlayout = 0;
piter->next();
}// end while
presultspace = 0;
after that, a context of database pdb is wrritten into file using writefile() function. i've checked that the drawing contains ellements in it's layouts but they are invisible. what am i doing wrong? i send an example. please help. it is emergency.
thanks.
attached files
insert() function always creates a new block. in your sample file layout "1" is associated with block "*paper_space" and the entities are in "*paper_space0" block.
sergey slezkin


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