高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】explodetoblock causes exception
explodetoblock causes exception
explodetoblock causes exception
i am currently using explodetoblock() with the attached file to explode all the blocks. it seems it will explode two blocks, but the third or forth block it tries to explode, would cause an exception and try{} would catch the error. i am currently using dwgdirect v1.11.01. does anybody know why this is the case? i was using v1.09 before and it seems to work fine then.
thanks
su ming
attached files
i can't reproduce the situation. what exception do you get? which blockreference is being exploded? what compiler do you use?
sergey slezkin
quote:
originally posted by sergey slezkin
i can't reproduce the situation. what exception do you get? which blockreference is being exploded? what compiler do you use?
i don't know the exception. i am using vc2002. the code is the following:
oddbobjectid msid = pdb->getmodelspaceid();
oddbblocktablerecordptr pms = pdb->getmodelspaceid().safeopenobject(oddb::kforwrite) ;
oddbobjectiteratorptr pmsents = pms->newiterator();
oddbobjectidarray idstoexplode;
while (!pmsents->done())
{
oddbobjectid entid = pmsents->objectid();
oddbentityptr pmsent = oddbentity::cast(entid.openobject(oddb::kforwrite) );
if (pmsent->iskindof(oddbblockreference::desc()))
{
oddbblockreferenceptr pblock = pmsent;
if (pmsent->explodetoblock(pms) == eok) {
idstoexplode.push_back(entid);
}
}
pmsents->step();
}
this was an example that neil gave me back when dwgdirect just came out.
thanks
su ming
i managed to get the error and it says 'scalar deleting destructor'(unsigned int). the error code is 38
i hope this helps
thanks
su ming
i reproduced the problem with you code. (exploding them one by one in odamfcapp works). we'll try to fix it.
sergey slezkin
as a workaround you can use the next code:
code:
pdb->starttransaction();
...
<your exploding code>
...
pdb->endtransaction();
regards,
sergey vishnevetsky
|