CAD上机作业.doc_第1页
CAD上机作业.doc_第2页
CAD上机作业.doc_第3页
CAD上机作业.doc_第4页
CAD上机作业.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

过程装备与控制工程专业过程装备CAD技术上机作业班级: 过程装备与控制工程12-3 姓名: 黄凌瑞 学号: 2012216538 2015年4月3(1)源程序:(command circle 0,0 36)(command circle 15,12 9)(command circle -15,12 9)(command circle 0,-8 4)(command donut 0 18 15,12 -15,12 )(command arc -18,-15 0,-25 18,-15)3(2)源程序:(setq plw 5);指定线宽(command pline 0,0 w plw 0,100 150,100 150,200 w 0 300,200 300,100 450,100 450,0 c)3(3)源程序:(initget 1)(setq p0 (getpoint 直线起点:);输入直线起点(initget 1)(setq cta (getreal 圆心线与水平线夹角:);指定圆心线与水平线夹角(initget(+ 1 2 4)(setq r (getreal 圆半径:);输入圆半径(initget(+ 1 2 4)(setq n (getint 圆的个数:);输入圆的个数(setq cta (/(* pi cta)180.0)(repeat n (command circle p0 r) (setq p0(polar p0 cta (* r 2)4、源程序:(setq a (getreal a=)(setq b (getreal b=)(setq r (getreal r=)(setq x1 (/ a 2)(setq x2 (expt r 2)(setq x3 (/(expt a 2) 4)(setq x4 (- x2 x3)(setq x5 (+(expt x4 0.5) r)(setq x6 (+ x5 b)(setq p0 (list a b)(setq p1 (list x1 x6)(setq p2 (list 0 b)(setq p3 (list 0 0)(setq p4 (list a 0)(command arc p0 p1 p2)(command pline p2 p3 p4 p0 )5、源程序:(command circle 100,100 200)(setq s1(ssget “L”)(command offset 30 s1 500,500)6、源程序:(command polygon 5 0,0 i 100 )(setq e1(entnext)(command circle 0,0 60)(setq s1(ssget “L”)(ssadd e1 s1)(command mirror s1 -100,-200 100,-200 )7:对话框文件:column1:dialog label=价格查询; spacer; :popup_list label=书籍名称; key=plist1; fixed_width=true; width=30; :edit_box label=单 价(元); key=edbox1; width=30; spacer; ok_only;驱动程序:(defun mainprogram() (setq plist_1(list 高等数学 大学物理 大学英语) (setq plist_2(list 26.00 30.50 28.00) (setq jiage 26.00) (liebiao) )(defun liebiao() (if( (setq dlg_id1(load_dialog e:20122165387.dcl) 0) (progn (if(new_dialog column1 dlg_id1) (progn (start_list plist1) (mapcar add_list plist_1) (end_list) (set_tile edbox1 26.00) (action_tile plist1 (plistaction) (setq flag(start_dialog) ) (alert Unable to display dialog box ) ) (unload_dialog dlg_id1) ) (alert Unable to load dialog box) ) )(defun plistaction(/ idnum) (setq idnum(get_tile plist1) (setq idnum(atoi idnum) (setq jiage(nth idnum plist_2) (set_tile edbox1 jiage)运行结果:8对话框文件id0:dialog label=算属相; spacer; :edit_box label=出生年份:; key=edbox1; width=20; spacer;:row :text label=属 相:; :text width=20; key=txt1; spacer;spacer; :row spacer; ok_only; spacer; 驱动程序:(defun ex9()(if(setq dlg_id1(load_dialog e:20122165388.dcl) 0) (progn (if(new_dialog id0 dlg_id1) (progn (set_tile edbox1 0000) (mode_tile edbox1 2) (action_tile edbox1 (edbox1action) (setq flg00(start_dialog) ) (alert unable to display dialog box) ) (unload_dialog dlg_id1) ) (alert unable to load dialog box) )(defun edbox1action() (setq flg1 0) (setq idnum(get_tile edbox1) (if(= flg00 1) (progn (setq a idnum) (setq idnum(atoi idnum) (setq b(itoa idnum) (if (= a b) (progn (setq idnum(rem idnum 12) (setq shuxiang(nth idnum plist_1) (set_tile txt1 shuxiang) ) (alert 请输入正确年份) ) ) ) ) (defun mainprogram() (setq plist_1(list 猴 鸡 狗 猪 鼠 牛 虎 兔 龙 蛇 马 羊) (ex9) 9:对话框程序:huatu:dialog label=图形绘制; spacer; :row :column :image key=image; width=20; aspect_ratio=0.5; color=-2; :column label=; :popup_list label=所开槽数:; key=pp1; list=1n2n3n4n5; width=20; :popup_list label=角度(cta):; key=pp2; list=15n20n30; width=20; :column :column label=起点坐标p0(单位:mm); :edit_box label=X坐标:; key=edbox1; value=0.0; :edit_box label=Y坐标:; key=edbox2; value=0.0; spacer; :column label=几何尺寸(单位:mm); :edit_box label=总体高度(H); key=edbox3; value=0.0; :edit_box label=顶边宽度(a); key=edbox4; value=0.0; :edit_box label=斜边长度(b); key=edbox5; value=0.0; :edit_box label=槽底宽度(c); key=edbox6; value=0.0; ok_cancel; 驱动程序:(defun mainprogram() (setq flag 0) (dialog1) (if (= flag 1) ;(progn (huagc) ;) );IF );DEFUN mainprogram(defun dialog1() (if ( (setq dlg_id1 (load_dialog E:20122165389.dcl) 0);加载对话框文件 (progn;progn1 (if (new_dialoghuatu dlg_id1);显示对话框(progn;progn2 ;以下初始对话框和描述文件控件 (start_image image) (setq max_x (dimx_tile image) (setq max_y (dimx_tile image) (slide_image 0 -50 max_x max_y D:2012216538GS.SLD) (end_image) (action_tile pp1 (plistaction1) (action_tile pp2 (plistaction2) (action_tile edbox1 (edbox1action) (action_tile edbox2 (edbox2action) (action_tile edbox3 (edbox3action) (action_tile edbox4 (edbox4action) (action_tile edbox5 (edbox5action) (action_tile edbox6 (edbox6action) ;(huagc) (setq flag (start_dialog);激活对话框 );end of progn2(alertunable to display dialog box);end if new dialog (unload_dialog dlg_id1);卸载对话框 );end of progn1 (alertunable to load dialog box) );end if load dialog );end of defun(defun plistaction1() (setq caosu (1 2 3 4 5) (setq csid (get_tile pp1) (setq csid (atoi csid) (setq cs (nth csid caosu) )(defun plistaction2() (setq jiaodu (15 20 30) (setq ctaid (get_tile pp2) (setq ctaid (atoi ctaid) (setq cta (nth ctaid jiaodu) )(defun edbox1action() (setq x (get_tile edbox1) (setq x (atoi x) )(defun edbox2action() (setq y (get_tile edbox2) (setq y (atoi y) )(defun edbox3action() (setq H (get_tile edbox3) (setq H (atoi H) )(defun edbox4action() (setq a (get_tile edbox4) (setq a (atoi a) )(defun edbox5action() (setq b (get_tile edbox5) (setq b (atoi b) )(defun edbox6action() (setq c (get_tile edbox6) (setq c (atoi c) )(defun huagc() (setq cta (/ (* pi cta) 180.0) (setq p0 (list x y) (setq pt (polar p0 (* 0.5 pi) H) (command pline p0 pt) (repeat cs (command (setq pt (polar pt 0 a) (setq pt (polar pt (- cta (* 0.5 pi) b) (setq pt (polar pt 0 c) (setq pt (polar pt (- (* 0.5 pi) cta) b) ) ) (command (se

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论