![]() |
【转帖】problems with r12 9dimensions0
problems with r12 (dimensions)
problems with r12 (dimensions) hello, i have created file tst.dxf in autocad r12. when this file is loaded by dwgdirect library, it does not read the tolerance flag correctly. tolerance is limit in this case, and all autocad versions show it correctly, only library does not set it to limit. i have tested also with odmfcapp (1.10). test with odmfcapp: load the dxf drawing and recompute dimension block, you will see, that dimension tolerance is not used. i added also dwg file, which is the same as dxf, only saved to dwg. when loading it into odamfcapp, application crashes. i suppose, that crash does not happen because of the library, while my application loads it without problems, only tolerance flag is not correct. regards, tomaz attached files hello, here i have one similar problem. the attached drawing contains dimension with alternate units. (but dwgdirect does not return dimalt flag as true). it can be also reproduced by odamfcapp. regards, tomaz attached files (7.0 kb, 13 views) hello, i can see, that odamfcapp with dd 1.10 (update 1) displays correct file dvojna1.dxf, but i still have some questions: i have a following code code: pdiment->getdimstyledata(&dimstyle); altdimflag = dimstyle.dimalt(); //alternate flag when this code checks the dimalt flag of dimension in file dvojna1.dxf, it returns 0. (no alternate dimension value). but autocad and odamfcapp recognizes this dimension with alternate value. when i experienced with the file, i found out that alternate dimension value depends on header op code $dimalt. please correct me if i am wrong, but i thought, that header $dimalt value is taken into account only when creating new dimensions?? so my question is how can i determine if dimension has alternate dimension value? up to now i checked only dimstyle.dimalt() flag. best regards, tomaz you can use functions like pdiment->dimalt(). but each call of such function requires much xdata processing, so if you frequently need to get different dimension variables, better way is: code: oddbdimstyletablerecordptr pdimvars = oddbdimstyletablerecord::createobject(); if (!pdiment->dimensionstyle().isnull()) { pdiment->getdimstyledata(pdimvars); } else { // set current database dimstyle & overrides // pdiment->setdimensionstyle(pdb->getdimstyle()); pdb->getdimstyledata(pdimvars); pdiment->setdimstyledata(pdimvars); } and then for getting actual dimension variables use functions like pdimvars->dimalt(). sincerely yours, george udov hello george, thanks for a tip how to get several dimension values faster. since the documentation about oddbdimension::getdimstyledata method says: quote: copies the dimension style data used by this data (including overrides), into the passed in dimension style table record. i am a little confused here. if a dimension does not have a dimension style, it uses the default one. why getdimstyledata does not copy values from default dimension style in such case? if you load the drawing "dvojna1.dxf" and run: code: pdiment->getdimstyledata(&dimstyle); altdimflag = dimstyle.dimalt(); //alternate flag altdimflag wil be 0. but if you call code: pdb->getdimstyledata(&dimstyle); altdimflag = dimstyle.dimalt(); //alternate flag altdimflag will be 1. in this example dimension does not have a dimension style, so i would expect, that pdiment->getdimstyledata will return the default dimension style with overrides. is this the correct behavior or is this a bug in dd library? best regards, tomaz |
所有的时间均为北京时间。 现在的时间是 08:09 AM. |