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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-04, 05:28 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】cannot open a dwg file in autocad - random problem

cannot open a dwg file in autocad - random problem
cannot open a dwg file in autocad - random problem
hi,
i often encounter the following error when opening a file generated by dd in autocad :
fatal error: unhandled access violation reading 0x002c exception at 2ch.
the bug happens randomly, undepending of the entities written in the file.
in the same time, i have no problem opening those files with dd. i use an old version of the dd because of the color problem, but it seems to also have happened with the new version (1.14.02).
it would be kind if you could like at the bogus file generated, which contains only one line.
thanks,
mst
attached files
almost all layers in your drawing (except layer 0) have bylayer color which is invalid for layer table record.
this causes autocad crash. autocad 2000 recover fixes this problem.
dwgdirect recover fixes it too.
sergey slezkin
thanks for your answer but i'm still not able to fix it because the problem still seems coming from dd. below the code which is used to set layers' color :
playtblrec = oddblayertablerecord::createobject();
layername = transstr.c_str();
playtblrec->setname(layername);
dvppix::color* pcolor = (*levelitr).getcolor();
static bool test = false;
if(pcolor && test)
{
odcmcolor color;
int rgbcolor[3];
pcolor->getcolor(rgbcolor, 255);
color.setrgb((oduint8)rgbcolor[0],
(oduint8)rgbcolor[1],
(oduint8)rgbcolor[2]);
}
else
{
color.setcolorindex(0);
}
playtblrec->setcolor(color);
i've added a boolean variable "test" for testing two different color setting code snippets. if test is set to "truth", all the layers' color use the rgb function (pcolor is never 0). in that case, the generated file is corrupted (autocad2000 cannot open it.) even if i try to recover it, autocad2000 sends an error message saying the recovered drawing is not valid.
if a set "test" to false, autocad2000 has no problem opening the generated file.
in any case, dd is able to open the generated files.
thanks,
mst
attached files (21.6 kb, 3 views)
(21.6 kb, 2 views)

which dd version do you use? dd recover (at least in 1.14) fixes the problem.
sergey slezkin
i'm using version 1.12.01. i had to roll back because of the color problem with the newest version.
when you wrote that dd recover (1.14) fixes this problem, you meant that it fixes it during the writing process, so i would have no problem opening the generated file in autocad2000 with this version?
if so, do you think setting the color index to 0 (as in my code snippet) for any layer would effectively patch the problem?
thanks,
mst
dd fixes the problem if you load the file with recoverfile() or call audit().
setrgb() sets color method to kbycolor and in your files color method is kbylayer.
i can't imagine how you created such file. it should work in early versions too.
sergey slezkin
i found the problem and it wasn't in dd.
thanks for your help!
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】a problem of ordinate dimension when exploding yang686526 DirectDWG 0 2009-05-04 03:12 PM
【转帖】a dwg file problem yang686526 DirectDWG 0 2009-05-04 03:06 PM
【转帖】使用.net在在文档状态栏实现文档标签控件功能 - 精华帖集合 yang686526 ObjectARX(VB.NET/C#) 0 2009-04-29 05:17 PM
【转帖】[翻译] metaprogramming with autocad (二) - 精华帖集合 yang686526 ObjectARX(VB.NET/C#) 0 2009-04-29 05:02 PM
【转帖】problem importing dxf file in sw2008 sp 4.0 - but no problem yang686526 SolidWorks二次开发 0 2009-04-13 01:34 PM


所有的时间均为北京时间。 现在的时间是 12:53 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多