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

yang686526 2009-05-07 06:41 PM

【转帖】wblockcloneobjects Problem
 
wblockcloneobjects problem
wblockcloneobjects problem
when i use wblockcloneobjects to copy some entities to another dwg, these is a crash happened.
pdb->wblockcloneobjects( ids, pdbother->getmodelspaceid(), *pmapping, oddb::kdrcreplace );
so i decide to clone each object except the error entity:
for(unsigned j=0; j<ids.size(); j++ )
{
oddbobjectidarray oneid;
oneid.push_back( ids[j] );
try
{
pdb->wblockcloneobjects( oneid, pdbsub->getmodelspaceid(), *pmapping, oddb::kdrcreplace );
}
catch (oderror& e)
{
cerr << "dwgdirect error: " << e.description() << endl;
}
catch(...)
{
cerr << "unknown error." << endl;
}
}
but there is still error happened when chlone each entity:
dwgdirect error: no active transactions
how can i do?
cloning transaction somehow gets aborted twice.
you may subscribe to rxevents, such as begindeepclone, beginwblockobjects, begindeepclonexlation, enddeepclone, abortdeepclone
, and dump id map at each step to see what's happening.
you may also turn on c++ exception interception, and post here a call stack of the point where first exception is thrown.
vladimir


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