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

oddbdatabase::lastsavedasversion returning 0
oddbdatabase::lastsavedasversion returning 0
we are just migrating from dwgdirect 1.13.02 to version 2.06.03. now, in the current version, oddbdatabase::lastsavedasversion() no longer gives the expected result. regardless of the input file the function always returns oddb::kdhl_mc0_0.
you can see this behavour, if you add these lines
oddb::dwgversion version = pdb->lastsavedasversion();
if (oddb::kdhl_mc0_0 < version && version < oddb::kdhl_unknown)
writeline(indent, dd_t("current file dwg version:"), tostring(version));
else
writeline(indent, dd_t("current file dwg version:"), "unknown");
to dbdumper::dumpheader in dbdumper.cpp in the odreadex example.
i need the correct file version info as input for oddbsymutil::isblockmodelspacename.
is this a known problem?
like in autocad after file loading the lastsavedasversion is 0 (unknown).
after you call writefile() the lastsavedasversion gets the value.
where is also originalfileversion, savedbyversion etc.
after file loading the database is always converted to current (latest) version.
so default parameter of isblockmodelspacename() is ok in most cases.
sergey slezkin
dear sergey,
i can not agree with your for two reasons:
1. a method that gives the correct answer only in most cases is worthless. i need a method that gives me the correct answer under all circumstances. (you'd probably appreciate this if i tell you that among our products is an onboard flight system.)
i have some dwg files that were originally created by r12, but later on were saved as acad2000. so the model space name in these files is "*model_space", but i can not use the 'originalfileversion' (which is r12), since it will give me wrong answer. but i have also some dwg files from r12 that were never altered, so their model space name is still "$model_space". so, here, the 'originalfileversion' is ok. but, as i stated before, it will only give the correct answer, if the file was never modified. a fact that i can not establish for sure.
that is the reason, why i used 'lastsavedasversion', which gave always the correct answer back in version 1.13.02.
probably a property like the savedbyversion you mentioned would do the trick, but i cannot find it in the the documentation.
2. now, i do not think that the described behaviour for 'lastsavedasversion' is in sync with autocad. may be, the 'version' of the database is unknown until it is saved for the first time. but the 'lastsavedasversion' is that version the file on the disk was last saved as. and this information is written into the file, so it should be available right after opening.
for these reasons, i regard the current behaviour as a regression bug.
kris.
dear kris,
if it's all about trying to acces the model space, as i wrote previously after file is loaded it's converted to the latest version. so model space block will always have "*model_space" name at run time.
also note that where is oddbdatabase::getmodelspaceid() function which will return id of model space block table record.
the change in behavior is not regression but the fix for 1.13 bug.
here is brief overview of version-related oddbdatabase functions:
version() - the version of database object. it's always the latest version because after loading the file is always converted to the latest one.
lastsavedasversion() - returns the version that the current drawing was last saved as in the current session. if the current session has not yet done a save on this drawing, then it returns zero.
it's used by application for example in such situation: you edited the drawing and saved it to r12. if you try to close the drawing's window you get a warning: "the drawing was not saved to the latest version. do you want to saved it (to the latest version)? yes/no/cancel.
originalfileversion() - version of the file which was loaded. if a r12 file was loaded and saved to r15 than after reloading the file originalfileversion will be r15.
originalfilesavedbyversion() - returns the version value of the last autocad product which saved the drawing file, not counting the current session.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】never returning function ending in external exception yang686526 DirectDWG 0 2009-05-06 06:26 PM
【转帖】c-str90 no longer returning a c string in dd2.0.2 yang686526 DirectDWG 0 2009-05-04 06:57 PM
【转帖】passing something to a function and returning 2 strings yang686526 SolidWorks二次开发 0 2009-04-13 01:18 PM
【转帖】cosmosworks object is returning null 9c==0 yang686526 SolidWorks二次开发 0 2009-04-13 09:57 AM


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


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