![]() |
【转帖】problem writing dwg 2000, 2004 files
problem writing dwg 2000, 2004 files
problem writing dwg 2000, 2004 files i'm using dwgdirect 1.9 libs for borland c++ builder on windows(32bit). when i try to write the database to dxf or dwg,r14, things work fine, but when i try to write to dwg,2000 or 2004, after a few k of the file is written, i get an exception: oderror: "was open for write" 00ef061e _throwexceptionldtc 00c3732b oddwgwriter::writedatabase 00860c16 oddbdatabase::writefile 006470fc dwgfile::write(this=:0012f8fc) 0064f9ca dwgfromsite::process(this=:0012f6f0, levels=:0012fb88, resstrm=:0012f974) 00646701 exportautocad(levels=:0012fb88, filename=:0012fa58, typ=0 /* dwg */, ver=23 /* r2000 */) oderror: "was open for write" 00ef061e _throwexceptionldtc 00c0fabb oddwgr18filewriter::wrobjects 00c09fa9 oddwgr18filewriter::writedatabase 008609a4 oddbdatabase::writefile 006470fc dwgfile::write(this=:0012efec) 0064f9ca dwgfromsite::process(this=:0012ede0, levels=:0012f278, resstrm=:0012f064) 00646701 exportautocad(levels=:0012f278, filename=:0012f148, typ=0 /* dwg */, ver=25 /* rev_current */) writes ok: 00646701 exportautocad(levels=:0012f278, filename=:0012f148, typ=0 /* dwg */, ver=21 /* r14 */) also typ of dxf works okay. this doesn't happen for every case, and i don't have an odwriteex test case that makes this happen (i'll keep trying), so i'm hoping this info might be enough to narrow it down. i wouldn't be surprised if its borland specific - i'd love to have the debug libs used to track down and fix "was open for write" exception during writing a file means that some object was modified and not closed by the moment writefile() is called. probably you have a smart pointer in your code pointing to some database object and as a result the object was not closed. maybe r14 works because the object is not written to this file version. sergey slezkin thanks! i did have a pointer to a blocktablerecord that was still around. zeroing it fixed the problem. strange that dxf and dwg r14 didn't complain.. |
所有的时间均为北京时间。 现在的时间是 12:51 PM. |