几何尺寸与公差论坛------致力于产品几何量公差标准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, 11:57 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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



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


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