几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】invalid inde (http://www.dimcax.com/hust/showthread.php?t=16915)

yang686526 2009-05-06 04:05 PM

【转帖】invalid inde
 
invalid index
invalid index
i've a dwg file, that during zoom-rect operation (as shown in .jpg file) generates
"invalid index" exception. i test it with odamfcapp.
i think the file is broken.
is any posibility to know just after loading the file without rendering, if it is broken?
my idea is that if the file is broken then try to recover it with dwg function without informing end-user.
i attach dwg file and screen with an error.
thanks in advance
mk
attached images
the crash in 1.13 is caused by invalid linetype data. it seems to be fixed in 1.14.
after loading a drawing (readfile()) you can call pdb->audit() but safest way is to load the drawing with recoverfile() function.
sergey slezkin
besides,
i have some russian dwg files (with the unicode signs \u+xxxx...)
using readfile i translate \u+xxxx into unicode and i got cyrilica and everything was ok.
if i read it with recoverfile the letters start look strange. there were no \u+xxxx
i still have 1.13 and in the moment cannot go into 1.14
readfile() has ballowcpconversion parameter and if it's true dd converts drawing at loading time to system code page.
unfortunately recoverfile() has no such parameter and drawing is loaded "as is". it's dwgcodepage after loading differs from system code page.
strange that for years nobody noticed this problem :-(
as a workaround you can save the file after recoverfile() and load it by readfile() with ballowcpconversion = true.
sergey slezkin
hi,
is there a plan to include ballowcpconversion option in recoverfile()?
regards,
varun
no. but there is a plan to remove this parameter from readfile(). it's not used since 2.0.
because starting with ac2007 and dd 2.0 text at runtime and inside dwg file is stored in unicode. so it's impossible to avoid conversion while loading pre-2007 files and load strings "as is".
sergey slezkin
so if i use recoverfile() now (with 2.2.0), it would work the same as readfile() with ballowcpconversion == true, for the purpose of text conversion?
regards,
varun
yes. now both readfile() and recoverfile() perform conversion to unicode at file loading.
sergey slezkin


所有的时间均为北京时间。 现在的时间是 01:56 PM.