高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】insert fails
insert fails
insert fails
hi, all
what i want to do:
merge 2 dxf-files. one file is a drawing frame, the other one is a normal dxf drawing. it is given, that i have to put all entities of drawing into frame and store all as a new dxf-file.
executing the following code, i got an error on insert-command: r6025 (pure virtual function call). could it be a problem, that modelspace in drawing is called *model_space and in frame *model_space ? if yes, what can i do because this is given.
code:
odstaticrxobject<myservices> svcs;
odinitialize(&svcs);
odgsinitialize();
oddbdatabaseptr pdatabasedrawing = svcs.readfile( drawingfile, false, false, oda::ksharedenyno );
oddbdatabaseptr pdatabaseframe = svcs.readfile( framefile, false, false, oda::ksharedenyno );
//collect all entities for wblock
oddbobjectid blockid;
oddbobjectidarray idarray;
oddbblocktableptr pblocks = pdatabasedrawing->getblocktableid().safeopenobject();
oddbsymboltableiteratorptr pblkiter = pblocks->newiterator();
for (pblkiter->start(); (! pblkiter->done()) ; pblkiter->step() )
{
oddbblocktablerecordptr pblock = pblkiter->getrecordid().safeopenobject();
std::cout << pblock->getname() << std::endl;
oddbobjectiteratorptr pentiter = pblock->newiterator();
for (pentiter->start(); !pentiter->done(); pentiter->step())
{
idarray.push_back(pentiter->objectid());
}
}
//wblock
oddbdatabaseptr ptempdb;
ptempdb = pdatabasedrawing->wblock(idarray, odgepoint3d::korigin);
//insert
pdatabaseframe->insert( odgematrix3d::kidentity, ptempdb);
//write merged file
odwrfilebuf outfile("d:/merged.dxf");
pdatabasedrawing->writefile(&outfile, oddb::kdxf, oddb::vac15, false, 16);
pdatabasedrawing.release();
pdatabaseframe.release();
ptempdb.release();
odgsuninitialize();
hi,
could you please test your code inside one of our sample? mfcapp for example and publish here code and results. also information about used toolkit version and dll\lib toolkit will be very helpful.
and usually we asked our members test here code with last toolkit release.
hi
i'm using opendesign 2.05 and i execute my code within the sample ""odvectorizeex".
i have built an own class and i could already insert everything from frame into dxf-file. (but without wblocking).
at command insert: the error is an ms c++ error, it's not said which class, but only ....odvectorizeex.exe (r6025, pure virtual function call).
thank you.
hi,
i have tested your code with current sources state and with 2.5.1. i cannot reproduce the problem. so could you please test your code with another input file set? for example, create two new dwg files with only one line in model space. will it crash too? yes - try to download our last release and test once more with both file set. it is possible that defect was fixed since 2.05.
hi
thank you very much for your reply. i will try to get last release und try with other files and let you know whether it works.
|