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