收藏 分销(赏)

液压常用密封元件参数化CAD图库设计.docx

上传人:可**** 文档编号:963246 上传时间:2024-04-09 格式:DOCX 页数:49 大小:413.63KB
下载 相关 举报
液压常用密封元件参数化CAD图库设计.docx_第1页
第1页 / 共49页
液压常用密封元件参数化CAD图库设计.docx_第2页
第2页 / 共49页
液压常用密封元件参数化CAD图库设计.docx_第3页
第3页 / 共49页
液压常用密封元件参数化CAD图库设计.docx_第4页
第4页 / 共49页
液压常用密封元件参数化CAD图库设计.docx_第5页
第5页 / 共49页
点击查看更多>>
资源描述

1、机电工程学院毕业设计说明书设计题目: 液压常用密封元件参数化CAD图库设计 学生姓名: 学 号: 专业班级: 机制F0706 指导教师: 2011年5月18日毕业设计(论文)任务书1本毕业设计(论文)课题应达到的目的:本题目是基于AutoCAD平台,应用AutoLISP等相关高级语言进行应用软件设计。密封元件是液压传动系统中应用量很大的辅助元件,其结构较复杂,品种多。在液压传动系统设计中绘图工作量较大。本软件的设计目的,就是使液压传动常用密封元件参数化,设计人员只需在程序引导下点选所需密封元件类型、规格,就可很快绘出相应密封元件视图,从而减轻设计人员劳动强度,提高设计效率。通过本设计可使学生在

2、分析了解液压传动常用密封元件结构和应用高级语言进行计算机软件设计方面得到较全面的训练。2本毕业设计(论文)课题任务的内容和要求(包括原始数据、技术要求、工作要求等):1技术要求:在熟悉加工精度统计分析方法、初步具备用高级语言编程的能力的基础上,设计液压常用密封元件参数化CAD图库,软件设计要求:(1)所绘制常用液压密封元件要符合国家标准;(2)能选择绘制常用液压密封元件的三视图;(3)要求人机交互界面友好,使用检索方便快捷。2工作要求:(1)收集相关资料,了解常用液压密封元件参数化CAD图库软件发展现状;(2)收集与本毕业设计相关的外文资料,翻译其中一篇;(3)制订软件设计方案,进行方案论证,

3、写出方案论证报告;(4)设计液压常用液压密封元件参数化CAD图库软件;(5)撰写毕业设计说明书。目次1 绪论12 AutoCAD的二次开发22.1 AutoCAD 二次开发的历史22.2 AutoCAD 二次开发的现状22.3 AutoCAD 二次开发的发展32.4 AutoCAD 二次开发工具种类33 CAD参数化设计技术63.1参数化设计技术63.2参数化设计的本质及意义63.3参数化设计在CAD中的应用64 液压密封元件参数化CAD图库系统开发84.1概述84.2开发流程94.2.1用DCL编写用户对话框界面94.2.2 SLD文件制作104.2.3国标数据文件制作104.2.4 LIS

4、P程序设计114.2.5自定义并加载局部菜单124.3程序的运行134.4液压常用密封元件参数化CAD图库开发结论165系统开发的优缺点及改进方向17谢辞18参考文献19附录120附录253附录3551 绪论2 AutoCAD的二次开发软件AutoCAD可用多种方法进行二次开发,为AutoCAD二次开发者提供了巨大的方便。2.4.1 AutoLISP2.4.2 ADS2.4.3 ObjectARX2.4.4 Vlisp2.4.5 VBA图4-1-1 系统组成4.2.1用户对话框界面设计根据设计意图,编写用户对话框(程序代码见附录2),如图4-2-1所示。图4-2-1a 用户对话框界面图4-2-

5、1b 用户对话框界面4.2.2 SLD文件制作4.2.3 国标数据文件制作由于在用户对话框中显示的国标数据和内部绘图函数调用的数据在格式上不同因此把同样的数据分别做成两份格式不同的文件保存,以遍内部函数调用如图4-2-4 4-2-4 绘图程序调用的表文件4.2.4 LISP程序设计图4-2-5 主程序流程图4.2.5 自定义并加载局部菜单4.3 程序的运行图4-3-1 自定义菜单图4-3-2 液压密封元件参数化图库图4-3-3 对话框响应用户动作界面图4-3-4基点输入提示图4-3-5 程序绘图图4-3-6 动态定位提示有时用户可能用户可能会误操作。此时,点击“确定”后会弹出AutoCAD信息

6、对话框,如图4-3-7所示。图4-3-7 信息提示4.4液压常用密封元件参数化CAD图库开发结论(1)、优点:比较综合的运用了AutoLISP 语言中的赋值(SETQ),极坐标求点(POLAR),表的嵌套,选择集的处理函数(SSADD),各种运算符(+ - * /),GET族函数等等。并且综合调用了AutoCAD中的画线(LINE PLINE)、画弧(ARC)、画圆(CIRCLE)、镜像(MIRROR)等命令。(2)、缺点及改进方向由于水平实在有限,加之时间仓促,程序中总会存在这样或那样的缺点与不足。主要有:程序中的参数化程度不够成熟,程序中的代码有重复和多余的部分,不够简洁,可读性有待提高。

7、所以,在今后的改进中要增加一些算法,使参数化程度提高,精简代码,增加一些注释使可读性提高等等。参考文献 附录1:Autolisp源程序代码;*主程序*(defun c:mftk () (setq gzlj C:/Users/NYD/Desktop/程序/);定义工作路径 (setq dcl_id (load_dialog (strcat gzlj mftk.dcl);加载对话框文件 (if (not (new_dialog mftk1 dcl_id );打开主界面 (exit) ) (dllist);向密封元件大类列表框中填内容 (action_tile list_1 (txlist2);选择

8、密封元件大类列表框中的内容切换夹具元件小类列表框中的内容 (action_tile list_2 (xssld1) ;选择密封元件小类列表框中的内容在图像控件中显示幻灯片 (action_tile button_xyb (cs1) ;点选一个密封元件切换到该元件尺寸对话框 (action_tile cancel (setq dell 0) (done_dialog 0);按取消键关闭对话框 (start_dialog) (unload_dialog dcl_id ) (fgxnyd);-自定义带形参处理-(defun cllbk (ck1 ck2) ;自定义处理列表框控件函数 (start_l

9、ist ck1) (mapcar add_list ck2) (end_list) ;向夹具元件大类列表框中填内容 )(defun txtc ( imagekey sldname);在图象控件中显示幻灯片 (setq x (dimx_tile imagekey) ;右下角 y (dimy_tile imagekey) ;坐标点 (start_image imagekey) (fill_image 4 4 (- x 10) (- y 10) 0) ;在现行激活框的图像控件上划一个填充矩形 (slide_image 4 4 (- x 10) (- y 10) sldname) ;在现行激活对话框图

10、象控件上显示一个autocad的幻灯片 (end_image) );-;-处理主对话框-(defun dllist () ;向主对话夹具元件大类列表框中填内容 (setq mfyjdl (密封圈 油封 垫片 ) ;密封元件大类 (cllbk list_1 mfyjdl) (setq mfqyj (o型密封圈 vd形橡胶密封圈a型 vd形橡胶密封圈s型 A型防尘圈 活塞杆用V型圈 轴用Y形圈 孔用Y形圈 C型防尘圈) (cllbk list_2 mfqyj) (txtc sld1 (strcat gzlj 11z) (setq dlbsz 1) ) (defun txlist2 () ;向主对话

11、框密封元件小类列表框中填内容 (setq mfqyj (o型密封圈vd形橡胶密封圈a型 vd形橡胶密封圈s型 A型防尘圈 活塞杆用V型圈轴用Y形圈 孔用Y形圈 C型防尘圈) ;密封圈元件分类 (setq ydyj (z形橡胶油封 油封皮纸圈 毡圈油封 ) ;油封元件分类 (setq dpyj (平面管法兰用非金属平垫片PN0.25MPa 平面管法兰用非金属平垫片PN0.6MPa 平面管法兰用非金属平垫片PN1.0MPa 平面管法兰用非金属平垫片PN1.6MPa 平面管法兰用非金属平垫片PN2.0MPa I型突面管法兰用非金属平垫片PN0.25MPa I型突面管法兰用非金属平垫片PN0.6MPa

12、 I型突面管法兰用非金属平垫片PN1.0MPa I型突面管法兰用非金属平垫片PN1.6MPa I型突面管法兰用非金属平垫片PN2.0MPa II型突面管法兰用非金属平垫片PN2.0MPa I型突面管法兰用非金属平垫片PN2.5MPa I型突面管法兰用非金属平垫片PN4.0MPa I型突面管法兰用非金属平垫片PN5.0MPa II型突面管法兰用非金属平垫片PN5.0MPa 凹凸面管法兰用非金属平垫片PN1.6MPa 凹凸面管法兰用非金属平垫片PN2.5MPa 凹凸面管法兰用非金属平垫片PN4.0MPa凹凸面管法兰用非金属平垫片PN5.0MPa 榫槽面管法兰用非金属平垫片PN1.6MPa 榫槽面管

13、法兰用非金属平垫片PN2.5MPa 榫槽面管法兰用非金属平垫片PN4.0MPa 榫槽面管法兰用非金属平垫片PN5.0MPa) ;垫片元件分类 (setq dlbsz 1) (setq dlbsz (+ 1(atoi (get_tile list_1 ) (cond (= dlbsz 1)(cllbk list_2 mfqyj) ;向密封元件小类列表框中填密封圈元件分类内容 (= dlbsz 2)(cllbk list_2 ydyj) ;向密封元件小类列表框中填油封元件分类内容 (= dlbsz 3)(cllbk list_2 dpyj) ;向密封元件小类列表框中填垫片元件分类内容 ) )(de

14、fun xssld1 () ;选择密封元件名,向图像控件中填相应幻灯片 (setq xlbsz (+ 1(atoi (get_tile list_2 ) (setq dlbszh (rtos dlbsz 2 0) xlbszh (rtos xlbsz 2 0) ;将十进制格式数转换成字符串 (setq yjxh (strcat dlbszh xlbszh) ;将多个字符串拼接成一个长字符串后返回。 (setq yjsldmb (11 11z) (12 12z) (13 13z) (14 14z) (15 15z) (16 16z) (17 17z) (18 18z) (21 21z) (22

15、22z) (23 23z) (31 31z) (32 32z) (33 33z) (34 34z) (35 35z) (36 36z) (37 37z) (38 38z) (39 39z) (310 310z) (311 311z) (312 312z) (313 313z) (314 314z) (315 315z) (316 316z) (317 317z) (318 318z) (319 319z) (320 320z) (321 321z) (322 322z) (323 323z) ;“xx”前x表示大类中第x项,后x表示小类中第x项 (setq yjsldm (strcat gzl

16、j (car(cdr (assoc yjxh yjsldmb);获取幻灯片文件路径 (txtc sld1 yjsldm) );-以上主对话框相关控制-(defun cs1();处理子对话框 (if (not (new_dialog mftk2 dcl_id ) (exit) ) (setq sth 1)(mode_tile button_st1 2);sth表示视图号 1即视图1 mode_tile设置该对话框控件聚焦 (setq sth2 1)(mode_tile button_st4 2);sth2表示标注项 4即无标注 mode_tile设置该对话框控件聚焦 (setq st 0) (c

17、ond (= yjxh 12)(setq st 1) (= yjxh 13)(setq st 1) (= yjxh 14)(setq st 1) (= yjxh 15)(setq st 1) (= yjxh 16)(setq st 1) (= yjxh 17)(setq st 1) (= yjxh 18)(setq st 1) (= yjxh 21)(setq st 1) ) (mode_tile button_st2 st);视图2禁用 (mode_tile button_st3 1) ;视图3禁用 (xssld2);显示幻灯片 (xsgbcc);在列表中显示国标尺寸 (action_til

18、e list_21 (jinggao);选取尺寸警告 (action_tile button_st1 (setq sth 1)(xssld2);点选单选按钮切换三图 (action_tile button_st2 (setq sth 2)(xssld2); (action_tile button_st3 (setq sth 3)(xssld2); (action_tile button_st4 (setq sth2 1);点选单选按钮切换是否标注尺寸 (action_tile button_st5 (setq sth2 2); (action_tile cancel (setq dell 0)

19、 (done_dialog 0);按取消键关闭对话框 (action_tile accept (jinggao2) ) ;启动绘图 (start_dialog) );-子对话框处理函数-(defun xssld2 () ;向子对话框图像控件中填相应幻灯片 (setq yjstsldmb (11 111 112 113) (12 121 122 123) (13 131 132 133) (14 141 142 143) (15 151 152 153) (16 161 162 163) (17 171 172 173) (18 181 182 183) (21 211 212 213) (22

20、 221 222 223) (23 231 232 233) (31 311 312 313) (32 321 322 323) (33 331 332 333) (34 341 342 343) (35 351 352 353) (36 361 362 363) (37 371 372 373) (38 381 382 383) (39 391 392 393) (310 3101 3102 3103) (311 3111 3112 3113) (312 3121 3122 3123) (313 3131 3132 3133) (314 3141 3142 3143) (315 3151 3

21、152 3153) (316 3161 3162 3163) (317 3171 3172 3173) (318 3181 3182 3183) (319 3191 3192 3193) (320 3201 3202 3203) (321 3211 3212 3213) (322 3221 3222 3223) (323 3231 3232 3233) ) ;xyz其中x表示大类元件中第x项 y表示小类元件中第y项 z表示视图z (setq yjstsldm (strcat gzlj (nth sth (cdr (assoc yjxh yjstsldmb) (txtc sld2 yjstsld

22、m)(defun jinggao ();选取尺寸警告 (setq chucuo(strcat 请选择国标尺寸!) (setq ccz (+ 1(atoi (get_tile list_21 ) (cond (= ccz 1)(alert chucuo) (cond (/= ccz 1)(dqgbcc) )(defun jinggao2 ();选取尺寸警告 (setq chucuo(strcat 请选择国标尺寸!) (setq ccz (+ 1(atoi (get_tile list_21 ) (cond (= ccz 1)(alert chucuo) (cond (/= ccz 1)(term

23、_dialog)(setq dell 1);*选定元件尺寸参数*(defun xsgbcc () ;在列表中显示国标尺寸 (setq shujukus (11 11.txt 11n.txt) (12 12.txt 12n.txt) (13 13.txt 13n.txt) (14 14.txt 14n.txt) (15 15.txt 15n.txt) (16 16.txt 16n.txt) (17 17.txt 17n.txt) (18 18.txt 18n.txt) (21 21.txt 21n.txt) (22 22.txt 22n.txt) (23 23.txt 23n.txt) (31

24、31.txt 31n.txt) (32 32.txt 32n.txt) (33 33.txt 33n.txt) (34 34.txt 34n.txt) (35 35.txt 35n.txt) (36 36.txt 36n.txt) (37 37.txt 37n.txt) (38 38.txt 38n.txt) (39 39.txt 39n.txt) (310 310.txt 310n.txt) (311 311.txt 311n.txt) (312 312.txt 312n.txt) (313 313.txt 313n.txt) (314 314.txt 314n.txt) (315 315.

25、txt 315n.txt) (316 316.txt 316n.txt) (317 317.txt 317n.txt) (318 318.txt 318n.txt) (319 319.txt 319n.txt) (320 320.txt 320n.txt) (321 321.txt 321n.txt) (322 322.txt 322n.txt) (323 323.txt 323n.txt) ) ;XY 其中x表示大类元件中第x项 y表示小类元件中第y项 (setq shujuku (strcat gzlj (car(cdr (assoc yjxh shujukus) (setq tmplst

26、 nil) (setq fn (open shujuku r) ;打开文件 (while (setq gg (read-line fn) ;读文件 (setq tmplst (append tmplst (list gg) ) (close fn) (setq tmplst tmplst);其余表项存入标准元件尺寸表 (cllbk list_21 tmplst) )(defun dqgbcc() ;*读取国标尺寸* (setq shujukun (strcat gzlj (nth 1 (cdr (assoc yjxh shujukus) (setq tmplstn nil) (setq fnn

27、 (open shujukun r) ;打开文件 (while (setq gg (read-line fnn) ;读文件 (setq gg (read gg) (setq tmplstn (append tmplstn (list gg) ) (close fnn) (setq mmm1(- (atoi (get_tile list_21 ) 1) (setq mmm (nth mmm1 tmplstn) ;把检索到的参数存到变量mmm中 ) ;*根据选择内容绘图*(defun fgxnyd () ;判断是否启动绘图函数 (cond (= dell 1)(fgxnyd1) ) (defun

28、fgxnyd1 () ;绘图主函数 (defun dtr(a) ;角度转换弧度函数 (* a (/ pi 180.0) ) (setq layer_name (tblsearch layer 粗实线层) ;检查及设置图层 (if (= layer_name nil) (command layer n 粗实线层 c 7 粗实线层 lw 0.3 粗实线层 ) ) (setq layer_name (tblsearch layer 细实线层) (if (= layer_name nil) (command layer n 细实线层 c 7 细实线层 lw 0.1 细实线层 ) ) (setq lay

29、er_name (tblsearch layer 中心线层) (if (= layer_name nil) (command layer m 中心线层 c 1 lw 0.1 中心线层 l center ) ) (setq layer_name (tblsearch layer 标注线层) (if (= layer_name nil) (command layer n 标注线层 c 3 标注线层 lw 0.1 标注线层 ) ) (setq nyd (nth sth (cdr (assoc yjxh yjstsldmb);判断要启动的绘图之程序 (cond (= nyd 111)(x111) (=

30、 nyd 112)(x112) (= nyd 113)(x113) (= nyd 121)(x121) (= nyd 122)(x122) (= nyd 123)(x123) (= nyd 131)(x131) (= nyd 132)(x132) (= nyd 133)(x133) (= nyd 141)(x141) (= nyd 142)(x142) (= nyd 143)(x143) (= nyd 151)(x151) (= nyd 152)(x152) (= nyd 153)(x153) (= nyd 161)(x161) (= nyd 162)(x162) (= nyd 163)(x1

31、63) (= nyd 171)(x171) (= nyd 172)(x172) (= nyd 173)(x173) (= nyd 181)(x181) (= nyd 182)(x182) (= nyd 183)(x183) (= nyd 211)(x211) (= nyd 212)(x212) (= nyd 213)(x213) (= nyd 221)(x221) (= nyd 222)(x222) (= nyd 223)(x223) (= nyd 231)(x231) (= nyd 232)(x232) (= nyd 233)(x233) (= nyd 311)(x311) (= nyd 3

32、12)(x312) (= nyd 313)(x313) (= nyd 321)(x321) (= nyd 322)(x322) (= nyd 323)(x323) (= nyd 331)(x331) (= nyd 332)(x332) (= nyd 333)(x333) (= nyd 341)(x341) (= nyd 342)(x342) (= nyd 343)(x343) (= nyd 351)(x351) (= nyd 352)(x352) (= nyd 353)(x353) (= nyd 361)(x361) (= nyd 362)(x362) (= nyd 363)(x363) (=

33、 nyd 371)(x371) (= nyd 372)(x372) (= nyd 373)(x373) (= nyd 381)(x381) (= nyd 382)(x382) (= nyd 383)(x383) (= nyd 391)(x391) (= nyd 392)(x392) (= nyd 393)(x393) (= nyd 3101)(x3101) (= nyd 3102)(x3102) (= nyd 3103)(x3103) (= nyd 3111)(x3111) (= nyd 3112)(x3112) (= nyd 3113)(x3113) (= nyd 3121)(x3121)

34、(= nyd 3122)(x3122) (= nyd 3123)(x3123) (= nyd 3131)(x3131) (= nyd 3132)(x3132) (= nyd 3133)(x3133) (= nyd 3141)(x3141) (= nyd 3142)(x3142) (= nyd 3143)(x3143) (= nyd 3151)(x3151) (= nyd 3152)(x3152) (= nyd 3153)(x3153) (= nyd 3161)(x3161) (= nyd 3162)(x3162) (= nyd 3163)(x3163) (= nyd 3171)(x3171) (= nyd 3172)(x3172) (= nyd 3173)(x3173) (=

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服