![]() |
【转帖】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 |
所有的时间均为北京时间。 现在的时间是 03:52 PM. |