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

a ordinate dimension problem when exploding
a ordinate dimension problem when exploding
hi,
i have an ordinate problem when exploding. now i use dd 1.10 update 1. the following is my code to export the ordinate dimension:
oddbordinatedimensionptr porddim = oddbordinatedimension::createobject();
porddim->setdimblockid( dimblockid );
porddim->setorigin( odgepoint3d( dimlinest[0],dimlinest[1],dimlinest[2] )); //dxf 10
porddim->setdefiningpoint( odgepoint3d( planept1[0],planept1[1],planept1[2] ));
porddim->setleaderendpoint(odgepoint3d(planept0[0],planept0[1],planept0[2]));
porddim->settextposition( odgepoint3d(textpt[0],textpt[1],textpt[2]) );
opening the attachment file in autocad and inserting the block named "front". comparing with this block, we can see that after exploding, the looks of ordinate dimension chang: the dimension lines disappear. if we modify the textmovement option in fit, the dimension lines appear but not are right.
i don't know what causes this difference when exploding. maybe i set some points or positions member error.
best regards
attached files

quote:
originally posted by enigma
opening the attachment file in autocad and inserting the block named "front". comparing with this block, we can see that after exploding, the looks of ordinate dimension chang: the dimension lines disappear. if we modify the textmovement option in fit, the dimension lines appear but not are right.
difference due to bug of recomputedimblock functionality of ordinate dimension. thank you for bugreport.
sincerely yours,
george udov
a ordinate dimension problem when exploding
quote:
originally posted by george udov
difference due to bug of recomputedimblock functionality of ordinate dimension. thank you for bugreport.
hi,
i think that you must have noticed that if exploding the insert block in autocad, the look is different from the insert. i think at least that when exploding an insert in autocad( not exploding with dd)fff">, the look is still the same as before. because the look will be changed when exploding the insert in autocad, so there must have some errors in my attachment file .e.g setting some point members error value. i have done several tests to fix this, but i haven't found it. would you like to tell me which point members are wrong?
also, i wrote my dwgdirect code by referring to my opendwg code. the following is my original opendwg code to export the ordinate dimension:
pent->dim.dimflag |= ad_dimtype_ordinate; //ordinate dimension
pent->dim.defpt2[0] = planept1[0];
pent->dim.defpt2[1] = planept1[1];
pent->dim.defpt2[2] = planept1[2];
pent->dim.defpt3[0] = planept0[0];
pent->dim.defpt3[1] = planept0[1];
pent->dim.defpt3[2] = planept0[2];
pent->dim.defpt4[0] = extline1end[0];
pent->dim.defpt4[1] = extline1end[1];
pent->dim.defpt4[2] = extline1end[2];
i don't know the corresponding functions to set these point members in dwgdirect . would you like to tell me which they are?
best regards

quote:
originally posted by enigma
hi,
i think that you must have noticed that if exploding the insert block in autocad, the look is different from the insert. i think at least that when exploding an insert in autocad( not exploding with dd)fff">, the look is still the same as before. because the look will be changed when exploding the insert in autocad, so there must have some errors in my attachment file .e.g setting some point members error value.
when you insert block in autocad, autocad doesn't recompute dimesion blocks. it shows them as they was computed by dd. but when you explode block containing dimension, autocad calls transformby() method of dimension to apply block transform. this sets the dimension's flag "modifiedgraphics", so dimension block is recomputed. so the look of dimensions changes after explode because dd's and autocad's recomputedimensionblock functionality works differently on such input data. differences in work of recomputedimensionblock functionality are dd's bugs, without relation to input data correctness. but such differences often appear on incorrect data - here you are right.
quote:
originally posted by enigma
i have done several tests to fix this, but i haven't found it. would you like to tell me which point members are wrong?
also, i wrote my dwgdirect code by referring to my opendwg code. the following is my original opendwg code to export the ordinate dimension:
pent->dim.dimflag |= ad_dimtype_ordinate; //ordinate dimension
pent->dim.defpt2[0] = planept1[0];
pent->dim.defpt2[1] = planept1[1];
pent->dim.defpt2[2] = planept1[2];
pent->dim.defpt3[0] = planept0[0];
pent->dim.defpt3[1] = planept0[1];
pent->dim.defpt3[2] = planept0[2];
pent->dim.defpt4[0] = extline1end[0];
pent->dim.defpt4[1] = extline1end[1];
pent->dim.defpt4[2] = extline1end[2];
first, opendwg doesn't write to file pent->dim.defpt4 for ordinate dimensions. pent->dim.defpt2 is for groupcode 13, pent->dim.defpt3 is for groupcode 14. so to be equal with opendwg code you should set points like this:
code:
porddim->setdefiningpoint( odgepoint3d( planept1[0],planept1[1],planept1[2] ));
porddim->setleaderendpoint(odgepoint3d(planept0[0],planept0[1],planept0[2]));
text is positioned automatically by default. also you shouldn't set origin.
sincerely yours,
george udov
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】a dimension error yang686526 DirectDWG 0 2009-05-04 03:05 PM
【转帖】a diameteric dimension problem when exploding yang686526 DirectDWG 0 2009-05-04 03:05 PM
【转帖】ordinate dimensions to define gdt datum structure yang686526 American standards 0 2009-04-29 09:04 PM


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


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