几何尺寸与公差论坛------致力于产品几何量公差标准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-05, 08:11 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】dwg vs dxf

dwg vs dxf
dwg vs dxf
is there a difference in the way these libraries process dwg and dxf files that might lead to a "was open for write" virtual method error?
my specific case involves the creation and deletion of raster attachments, as well as moving non image objects.
a hint of what kinds of things to look for in my code would be helpful (there's really too much code involved in this problem for me to post it all here)
thanks
clarification
the error only occurs when i run dwg files (and not when i run dxf files)
you may catch oderror_wasopenforwrite exception, and look what object is open via oderror_wasopenforwrite::getobjectid()
vladimir
what version has this?
indeed, it appeared to be missing in public headers.we well move it there in the next release, sorry for inconvenience.
for now you may declare this class manually somewhere in you code:
code:
class toolkit_export oderror_wasopenforwrite : public oderror
{
public:
oderror_wasopenforwrite(oddbobjectid id);
oddbobjectid getobjectid() const;
};
vladimir
am i missing something?
ok thanks, it now compiles with that addition, but now it seems to skip over the catch, and still enters the standard oderror catch:
...
catch (const oderror_wasopenforwrite& err)
{
oddbobjectid errobj = err.getobjectid();
odstring msg = errobj.gethandle().ascii();
std(cout) << "\naddimages oderror_wasopenforwrite thrown: " << msg.c_str()
<< " was still open" << std(endl);
return 1;
}
catch (oderror& err)
{
odstring msg = svcs.geterrordescription(err.code());
std(cout) << "\naddimages oderror thrown: " << msg.c_str() << std(endl);
return 1;
}
catch (...)
{
std(cout) << "\nsome general exception thrown during addimages, exiting\n";
return 1;
}
return 0;
}
is there something i'm still missing?
and what does stack trace look like, if you place break point in the second catch clause?
did you try to cast oderror& to oderror_wasopenforwrite&
if code()==ewasopenforwrite?
vladimir
found a fix
casting oderror& to oderror_wasopenforwrite& seemed to work, but only when i added this line to the temp header for oderror_wasopenforwrite:
oderror_wasopenforwrite(oderror err) : oderror(err){}
... now i just need to find out why these images are not closing
i want to add about difference between processing dwg and dxf. the only difference is that in previous dd versions the check if object is opened for write was made only while writing object to dwg file. currently the check is made while saving dxf too.
saving to file modified and not closed object may result in writing an invalid file.
sergey slezkin
thanks (dwg issue apparently resolved)
after taking a break from my dxf issues, i went ahead and resolved the issues i was having writing out to dwg files... it seems that my list object was keeping references of the images alive after i was done using them.
i had tried clearing it out before, but apparently trying to do so before the database audit caused issues.... instead i now clear out the list just before i write to file.
thanks,
~chuck
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】problem importing dxf file in sw2008 sp 4.0 - but no problem yang686526 SolidWorks二次开发 0 2009-04-13 01:34 PM
【转帖】create dxf macro yang686526 SolidWorks二次开发 0 2009-04-13 10:00 AM
【转帖】auto create 11 flat pattern and save as dxf yang686526 SolidWorks二次开发 0 2009-04-13 09:08 AM
【转帖】saving a single sheet as dxf yang686526 SolidWorks二次开发 0 2009-04-12 10:18 PM
【发布】读取dxf格式文件 huangyhg CAD文件存储格式 2 2008-09-25 05:07 PM


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


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