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

oddbfcf: problem calculating the bounding points
oddbfcf: problem calculating the bounding points
hi,
i am trying to get the bounding points of a geometrical tolerance.
per default the location of the tolerance is set to the middle of the left border. i want to place the location now to the middle of the right side of the tolerance box. but this somehow leaves a gap between calulated point and border.
my code to determine and set the tolerance's location to the left (default) or right side of the tolerance box is the following:
oddbfcfptr ptolerance = oddbfcf::createobject();
ptolerance->setdatabasedefaults(pdb);
ptolerance->settext(tolerancetext);
[.....]
odgepoint3darray boundingpoints;
ptolerance->getboundingpoints(boundingpoints);
double tolerancelength = boundingpoints.at(1).x;
double toleranceheight = (boundingpoints.at(1).y+boundingpoints.at(2).y)/2;
if(remarkisrightoftolerance == true){
//the block's origin will be on the *left* side on the
//tolerance
ptolerance->setlocation(odgepoint3d.korigin);
bbtr->setorigin(odgepoint3d.korigin);
}else{
//the block's origin will be on the right side on the
//tolerance
ptolerance->setlocation(odgepoint3d.korigin);
bbtr->setorigin(odgepoint3d(tolerancelength,0,0));
}
when setting the location to the right side, there is always a small gap between location-point and the tolerance box. (see in the attached .dwg file the tolerance 1*)). when the location-point is at it's default position (on the left side) it always works perfectly fine.
tolerance text to create the tolerances in the attached file:
1*): "{\\fgdt;b}%%v{\\fgdt;}0.003%%v{\\fgdt;}ab"fff"> error: this one has a gap!
2*): "{\\fgdt;b}%%v{\\fgdt;}0.003%%v{\\fgdt;}ab"fff"> this one works fine.
3*): "{\\fgdt;b}%%v{\\fgdt;}0.003" fff"> this one has no gap and works fine!
i think the error is in my escape sequence, since remark number 3*) works fine. could you provide me the correct escape sequence to have no gap in remark 1*)?
cheers and thanks a lot,
christoph
attached files
hello christoph,
extents tolerance are (0, -0.18, 0) (1.83, 0.18, 0) but block original is (1.83384, 0, 0) and gap is 0.00384 in your file for case 1. i suppose your code has mistake. check tolerancelength value in debug for this case.
here is about escape sequences. records {\\fgdt;}0.003 and {\\fgdt;}ab haven't sense because texts "0.003" and "ab" will be rendered by font from text style and {\\fgdt;} may be escaped. in case {\\fgdt;0.003} and {\\fgdt;ab} texts "0.003" and "ab" will be rendered by gdt.shx font.
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】newbie how to draw a ucs icon yang686526 DirectDWG 0 2009-05-06 06:30 PM
【转帖】how to export hideline data yang686526 DirectDWG 0 2009-05-06 02:35 PM
【转帖】asme - where to star yang686526 American standards 0 2009-04-29 07:28 PM


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


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