高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】empty model space. why
empty model space. why?
empty model space. why?
hi, here attched you can find a dwg file.
when i try to import it i find that the model space
has non entities.
the code i use is:
oddbblocktablerecordptr pms = pdb->getmodelspaceid().openobject();
oddbobjectiteratorptr pentiter = pms->newiterator();
oddbobjectiteratorptr pentiter = pblock->newiterator();
for (; !pentiter->done() ; pentiter->step()) {
oddbobjectid entid = pentiter->objectid();
if(!entid.isnull() && entid.isvalid()) {
importentity(pdb, entid, list);
}
}
but no entites is loaded.
if i import the same file with brava free dwg i can see it correctly.
what am i doing wrong ?
thank you very much in advance.
bye,
federico
attached files
how do you read the drawing?
you may build our odreadex sample and debug with it.
vladimir
hi vladimir,
i have tried with odreadex and it works.
i use:
pdb = m_dxfdwgserver.recoverfile( m_dxfdwgserver.createfile(pszfile), &aiinfo );
to read the file.
if, as in odreadex, i use
pdb = m_dxfdwgserver.readfile( pszfile, false, bpartial, oda::ksharedenyno );
i have no problems.
can you tell me why in my situation i have not success?
thank you in advance.
bye,
federico
replace readfile with recoverfile in odreadex, and rebuild it. i think you'll get the same result.
then compare this sample with your application, step by step (services, modules, etc.).
vladimir
hi vladimir,
i have substituted readfile with recoverfile as in my project and i find
the same behaviour.
what i mean is that with recoverfile no entites has been found in the block.
infact in file dbdumper.cpp of odreadexfile at line 959:
for (; !pentiter->done(); pentiter->step())
{
/************************************************** ******************/
/* dump the entity */
/************************************************** ******************/
dumpentity(pentiter->objectid(), indent+1);
}
the condition pentiter->done is immediatly true.
if, instead, i use readfile this condition is not immediatly true.
what am i doing wrong?
bye,
federico
i can't reproduce that.
what dd version do you use?
vladimir
hi vladimir,
i am using 2.4.0 version.
if i use my previous version of opendwg (2.2.0) it works correctly.
i attach here the output files obtained by odreadex.exe: one is obtained with readfile instruction and the other by recoverfile. as you can see they are quite different.
i hope to have helped you.
bye,
federico
attached files (434.2 kb, 1 views)
(30.5 kb, 0 views)
hi vladimir,
by odreadex i have created a dump with dbaudit:rinterror function.
i attach here the dump.
i hope it can help you.
bye,
federico
attached files (38.4 kb, 1 views)
recover for dwg files is broken in 2.4.0
in 2.4.1 it's broken for dwg r18 (ac2004-2006) files.
2.4.2 (to be release in a week) will contain the fix.
sergey slezkin
i will wait for the fix.
thank you,
federico
|