ImageVerifierCode 换一换
格式:DOCX , 页数:21 ,大小:244KB ,
资源ID:19276851      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/19276851.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(第一章渐开线直齿轮的二次开发Word文档格式.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

第一章渐开线直齿轮的二次开发Word文档格式.docx

1、do/l20:,ak,0,36rk=0.5*db/cosf(ak)ok=sinf(ak)/cosf(ak)-ak*&pi/180xk=rk*cosf(ok*180/&pi)yk=rk*sinf(ok*180/&pp(ak+1)=point/xk,ykl20:(2) 渐开线直齿轮的参数d=m*zdb=d*cosf(a)da=d+2*ha*mdf=d-2*(ha+c)*ms=&pi*m/2ra=da/2rd=d/2rf=df/2rb=db/2其中是m模数,z是齿数,a是压力角,ha是齿顶高系数,c是径向间隙系数,d是分度圆直径,db是基圆直径,da是齿顶圆直径,df是齿根圆直径,s是分度圆上齿轮的

2、厚度。(3) Grip程序的实现number/m,z,a,w,ha,cnumber/mat(12),mat1(12),mat2(12),mat3(12),mat4(12)data/ha,1,c,0.25entity/involute,gda,gdb,gdf,gd,invo_rot,pt_mir,ln_mir,invo_mir,ln1,invo_lnentity/pp(37),pt,pt1,pt2,pt3,pt4,pt5,pt6,pt7(1000),curda,curdf,pp2,ptorientity/solid,shape(1000),shape1(1000),shape2(1000)ent

3、ity/shape3(1000),shape4(1000),shape5(1000)ufargs/m,z,a,wifthen/z120messg/输入齿数超过120!jump/stop:endifd=m*zdo/l20:gda=circle/0,0,0,ragd=circle/0,0,0,rdgdf=circle/0,0,0,rfgdb=circle/0,0,0,rbinvolute=spline/ppcrvtrm/involute,ref,pp(37),first,gda,notrim,status,stusview/7pt=point/intof,gd,involutemat=matrix

4、/xyrot,(s/rd)*(180/&pi)/2pt_mir=transf/mat,ptptori=point/0,0,0ln_mir=line/ptori,pt_mir,perpto,gdablank/gda,gdfifthen/dfdbln1=line/pp(1),pp(1),tanto,involutepp2=point/xlarge,intof,ln1,gdfdelete/ln1ln1=line/pp(1),pp2mat1=matrix/mirror,ln_mirinvo_mir=transf/mat1,involuteinvo_ln=transf/mat1,ln1pt4=point

5、/intof,gda,ln_mirpt5=point/intof,gda,involutept6=point/intof,gda,invo_mircurda=circle/pt5,pt4,pt6pt1=point/intof,gdf,ln1mat4=matrix/xyrot,360/zpt1=transf/mat4,pt1pt2=point/intof,gdf,invo_lnpt3=point/intof,gdf,ln_mirpt7(1)=pt3j=1do/l30:,i,1,2*z-1mat3=matrix/xyrot,i*180/zifthen/modf(i,2)pt7(j+1)=trans

6、f/mat3,pt7(1)j=j+1l30:curdf=circle/pt2,pt7(2),pt1shape(1)=involuteshape1(1)=ln1shape2(1)=curdfshape3(1)=invo_lnshape4(1)=invo_mirshape5(1)=curdado/l40:,i,1,z-1mat2=matrix/xyrot,i*360/zshape(i+1)=transf/mat2,shape(1)shape1(i+1)=transf/mat2,shape1(1)shape2(i+1)=transf/mat2,shape2(1)shape3(i+1)=transf/

7、mat2,shape3(1)shape4(i+1)=transf/mat2,shape4(1)shape5(i+1)=transf/mat2,shape5(1)l40:mask/2delete/allmask/3blank/allmask/5mask/9solid=solext/shape(1.z),shape1(1.z),shape2(1.z),$ shape3(1.z),shape4(1.z),shape5(1.z),$ height,w,axis,0,0,1elsecrvtrm/involute,ref,pp(1),first,gdf,notrim,status,stuspt1=poin

8、t/intof,gdf,involutept2=point/intof,gdf,invo_mirdo/l50:l50:shape1(1)=curdfshape2(1)=invo_mirshape3(1)=curdado/l60:l60: shape3(1.z),height,w,axis,0,0,1stop: halt(4) 编译和连接对UG/Open Grip 程序通过UG自身带的NX Open Grip进行编译和连接,生成*.grx文件,之后就能在启动UG之后进行调用,进行自动建模了。三、用户界面设计编译完成的Grip程序在使用时需要用户进行手动调用,在实际运用时可能会存在麻烦,所以可以进

9、行对用户友好的界面设计,从而更进一步简化设计过程。1. UG应用开发环境设计(1) 新建文件夹,并在该文件夹下建立startup和application连个文件夹,startup子文件夹用于放置菜单以及dll文件,application子文件夹用于放置对话框文件*.dlg。(2) 注册环境变量,新建变量名“UGII_USER_DIR”,变量值为上述文件夹的地址。这样,以便UG在进行程序调用时成功能进行动态链接。如图1所示。图1 环境变量设置2 . 菜单设计在startup文件夹下,新建菜单文件(.men),内容如下:VERSION 120EDIT UG_GATEWAY_MAIN_MENUBAR

10、AFTER UG_APPLICATIONCASCADE_BUTTON gear_menuLABEL 齿轮参数化设计系统END_OF_AFTERMENU gear_menuBUTTON zgearLABEL 渐开线直齿轮ACTIONS zgear.dlgEND_OF_MENU上面的脚本程序将添加菜单栏项目如图2所示: 图2 菜单栏3 . UIStyler 对话框设计启动UG的UIStyler制作对话框界面,完成后的对话框界面如图3所示。图3 对话框界面 在此对话框中有5个文本框,【确定】按钮和【取消】按钮,对话框及对话框中各控件的属性如图4和图5所示。图4对话框属性图5 对话框属性的定义在此对话

11、框中,定义了4个回调函数。Cancel按钮回调函数cancel_zgear,构造回调函数constructor_zgear,析构回调函数destructor_zgear,OK按钮回调函数ok_zgear,如图6所示。图6回调函数的定义最后,将制作完成的对话框另存至上述建立的application文件夹中。4 . 使用 Visual C+建立应用程序框架编写相应的回调函数,代码如下:(1) 框架源程序:#ifndef ZGEAR_H_INCLUDED#define ZGEAR_H_INCLUDED #include #include uf_styler.h#ifdef _cplusplusext

12、ern C #endif#define ZGEAR_NUM (NUM)#define ZGEAR_M (M#define ZGEAR_Z (Z#define ZGEAR_A (A#define ZGEAR_W (W#define ZGEAR_DIALOG_OBJECT_COUNT ( 5 )int ZGEAR_constructor_zgear ( int dialog_id, void * client_data, UF_STYLER_item_value_type_p_t callback_data);int ZGEAR_donstructor_zgear ( int dialog_id,

13、int ZGEAR_ok_zgear ( int dialog_id,int ZGEAR_cancel_zgear ( int dialog_id,void write_para(int dialog_id);#endif /* ZGEAR_H_INCLUDED */(2) 对话框源程序:stdlib.hstdio.huf_exit.huf_ui.huf_mb.hmath.h#include zgear.h#define ZGEAR_CB_COUNT ( 4 + 1 ) UF_STYLER_item_value_type_t data5;static UF_STYLER_callback_in

14、fo_t ZGEAR_cbsZGEAR_CB_COUNT = UF_STYLER_DIALOG_INDEX, UF_STYLER_CONSTRUCTOR_CB , 0, ZGEAR_constructor_zgear, UF_STYLER_DIALOG_INDEX, UF_STYLER_DESTRUCTOR_CB , 0, ZGEAR_donstructor_zgear, UF_STYLER_DIALOG_INDEX, UF_STYLER_OK_CB , 0, ZGEAR_ok_zgear, UF_STYLER_DIALOG_INDEX, UF_STYLER_CANCEL_CB , 0, ZG

15、EAR_cancel_zgear, UF_STYLER_NULL_OBJECT, UF_STYLER_NO_CB, 0, 0 ;static UF_MB_styler_actions_t actions = zgear.dlg,NULL, ZGEAR_cbs, UF_MB_STYLER_IS_NOT_TOP , NULL, NULL, NULL, 0 /#ifdef MENUBAR_COMMENTED_OUTextern void ufsta (char *param, int *retcode, int rlen) int error_code; if ( (UF_initialize()

16、!= 0) return; if ( (error_code = UF_MB_add_styler_actions ( actions ) ) != 0 ) char fail_message133; UF_get_fail_message(error_code, fail_message); printf ( %sn, fail_message ); UF_terminate();/#endif #ifdef DISPLAY_FROM_CALLBACKextern int ( int *response ) int error_code = 0; if ( ( error_code = UF

17、_initialize() ) != 0 ) return (0) ; if ( ( error_code = UF_STYLER_create_dialog ( , ZGEAR_cbs, ZGEAR_CB_COUNT, NULL,/ response ) ) ! UF_UI_set_status (fail_message); return (error_code);#endif #ifdef DISPLAY_FROM_USER_EXITextern void (char *param, int *retcode, int rlen) int response = 0; if ( ( UF_

18、initialize() ) ! ZGEAR_cbs, /* Callbacks from dialog */ ZGEAR_CB_COUNT, /* number of callbacks*/ NULL, /* This is your client data */ &response ) ) !extern int ufusr_ask_unload (void) return ( UF_UNLOAD_IMMEDIATELY );extern void ufusr_cleanup (void) UF_STYLER_item_value_type_p_t callback_data) if (

19、UF_initialize() ! return ( UF_UI_CB_CONTINUE_DIALOG ); UF_terminate (); return (UF_UI_CB_CONTINUE_DIALOG); UF_STYLER_item_value_type_t num; num.item_attr=UF_STYLER_VALUE; num.item_id=ZGEAR_NUM; UF_STYLER_ask_value(dialog_id,&num); if(num.value.string)= uc1601(齿轮号不能为空!,1); return ( UF_UI_CB_CONTINUE_D

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1