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

yang686526 2009-05-06 03:58 PM

【转帖】inserting block
 
inserting block
inserting block
hello !
i want to insert a specific block from a database to another.
here is my code :
code:
oddbdatabaseptr pexportdb;
oddbblocktableptr pdesttable;

oddb::measurementvalue measure = oddb::kmetric;
pexportdb = createdatabase(true, measure);

pdesttable = pexportdb->getblocktableid().openobject(oddb::kforwrite);

oddbblocktableptr pactualdbtable = m_pdb->getblocktableid().openobject(oddb::kforread);
oddbsymboltableiteratorptr pactualdbti = pactualdbtable->newiterator(true, true);

while( !pactualdbti->done() )
{
oddbblocktablerecordptr pactualblock = pactualdbti->getrecord();
if( !pactualblock->islayout() && !pactualblock->isanonymous() && !pactualblock->isfromexternalreference() )
{
odstring blockname = pactualblock->getname();
if( pdesttable->has( blockname ) == false && blockname=="general surgery or light")
{
pexportdb->insert(blockname, blockname, m_pdb, true);
}
}
pactualdbti->step();
}
the program doesn't crash, but i get an "first-chance exception error" and when i look at my destination database, i have a block (with the same name of the one i wanted to copy - this is good), but empty !
do you have an idea of where this error could come from ?
thank you very much for your help !
cnice
it appears to be a dd bug described in
it will be fixed in the next maintenance release (1.14.03)
regards,
sergey vishnevetsky


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