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

assert in dbole2frame.cpp during readfile
assert in dbole2frame.cpp during readfile
i get an assert while loading a client file using the 1.14.01 dbg lib.
using the release version of the lib the file loads without problems.
the dwg file is almost 18 meg in size so i'll refrain from posting it unless you really need it
assertion failed!
.
file: source\database\entities\dbole2frame.cpp
line: 506
expression: modelflag()==nmodelflag
could you please shead some light over the meaning of this error?
regards,
mikael
oddbole2frame entity (in dwg file) contains a flag saying that the entity resides in model space.
the assert checks if this flag and entity's owner match.
probably the file was saved by non-acad application.
does the assert go away if the file is resaved by autocad?
sergey slezkin
i can't get this assert to go away, tried resaving, recover, purge... in autocad and the drawing still won't load in the dbg lib.
the file has probably first been created with dwgdirect v1.12 or so.
then imported into solidworks and then exported from there.
this customer works extensively with solidworks so it's quite reasonable to expect a drawing like this to go through several imports and exports.
it also looks like the drawing has been through at least one recover step in autocad as there's several audit blocks in there. i suspect that solidworks might create incorrect anon block names judging from previous drawings from this customer.
assert in debug build does not prevent file from loading.
default implementation of this function terminates console application but this functionality can be customized.
see diagnostics.h:
odsettracefunc() anf odsetassertfunc()
they are used in odamfcapp, odvectorizeex, odgetgeomex...
sergey slezkin
oh, sorry. i can see i weren't clear. i did get it to load using custom assert functions, no problem.
i only can't create a version of the drawing that will load without an assert short of deleting the oddbole2frame entity.
so i'm still confused about this type of entity.
can they only exist directly in model/paper space blocks?
the group code 72 only has two possible values for this entity. 0 for model space or 1 for paper space. but in the drawing the frame resides in a block with a block ref referring to it in model space.
is this an invalid case, should you not be able to place this frame entity inside other blocks?
or is it that group code 72 in the dwg file refers to the top level owner not the immediate owner?
regards,
mikael
autocad does not allow to put an ole2frame object into a block via user interface. if such file is created somehow (i manualy edited dxf) autocad's behaviour is strange: it applies block reference transform to the border of entity (rectangle) but the picture is not transformed.
so the answer is: ole2frame entity can be put only into layout blocks (model or paper space).
essentially ole2frame entity provides a window to display the ole 2 object it has a pointer to. and if a block with ole2frame is inserted multiple times all instances of oleobject coincide on screen because block reference transform is not applied to them.
does the assert remain after the file is resaved by dd?
btw, about immediate or top level owner: the same block can be inserted multiple times in both model and paper space.
sergey slezkin
our current implementation ignores all entities that we don't need. so we never resave the drawing with the frame.
but a quick test using odamfcapp with loading and resaving show that it keeps the block structure intact. the new drawing still has a frame inside a block and thus i get the same assert loading the new file.
i've attached a stripped version of the drawing. the only thing left is the drawing header block containing the company logo inside an ole frame.
attached files (462.6 kb, 6 views)

if i open the file with odamfcapp i see the assert. but if i save it by odamfcapp to assert-s.dwg for example and load the new file where is no the assert.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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



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


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