CAD拼图程序lisp程序_第1页
CAD拼图程序lisp程序_第2页
CAD拼图程序lisp程序_第3页
CAD拼图程序lisp程序_第4页
CAD拼图程序lisp程序_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

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

文档简介

1、CAD拼图程序lisp程序(defun c: pintu (s1 s2 (pt1 pt2 in na.)(setvar blipmode)(setvar cmdecho)(get _ rowandcolumn)(setq p1 (getpoint n 输入起始点 )(setq p0, p1).(setq pa0 (0 to 10)(setq pai (list (as pa0) - (framework pa0) (2000)(setq pa2 (list + (pa1) (2000) (framework pa1)(setq pa3 (list (pa2) - (framework pa2)

2、 (2000)(setq pa4 (list + (pa3) (pa3) framework)(setq p0, p1).(setq v1 (getvar osmode)(setvar osmode)(command zoom, r)(setq numa2)(setq numa3)(setq (0)(m), 列清零 (setq j ().(j),(setq s1 (ssget w p1 (list + (p1) 1190) + (connection p1) 845)(the s1.(command copy s1 , p1 (0)(getboundingbox)(command zoom,

3、r)(setq s2 (ssget w (5 / 5) (1190 850)(cond( = sd (sd = 1195) 1185)(progn (command move s2 (0) pa0) (setq pa0 (list + (pa0)(1500) framework pa0)( = sd (sd = 835 845)(progn (command move s2 (0) (setq pai (pai) list (pa1) -(framework pa1) 614)( = sd (sd = 600) 590)(progn (command move s2 (0) (pa2).(se

4、tq numa2 (1 + numa2)(if (= (rem numa2 (2)(setq (list (pa2 pa2) - (framework pa2) 440)(setq (list + (pa2 pa2) 614) + (framework pa2) 440)( = sd (sd = 425)(progn (command move s2 (0) pa3)(setq numa3 (1 + numa3)(if (= (rem numa3 (2)(setq pa3 (list + (pa3) 440 (pa3) framework)(setq pa3 (list (pa3) 440)

5、framework pa3) 317)( = (dd)(progn (command move s2 (0) (pa4) setq pa4 (list + (pa4) (framework pa4); (t (setq fn (strcat f / a4 / tuhao a4.dwg)(setq s1.)(setq p1 (list + (p1) 1 (p1) framework)(setq j (1 + j).)(setq p0 (list (car p0) (- (cadr p0) 1500)(setq p1 p0)(setq in (1 + 1)(setvar osmode v1); (

6、setvar osmode 16383)(prince); 取得图幅幅面宽度以便判断图幅大小(defun getboundingbox (/ ss pt2 in pt _ list pt10 pt11 a endata my _ x max _ x my _ x _ pt _ listmax _ x _ pt _ list my _ x _ pt max _ x _ pt)(setq pt2 (list (+ (car p1) 1195) (+ (cadr p1) 850)(setq ss (ssget w p1 pt2 (0. line )(setq in 0)(setq pt _ list

7、 nil); 获取所有直线端点并赋值给 pt _ list(repeat (sslength ss)(setq a (ssname ss in)(setq endata (entget a)(setq pt10 (cdr (assoc. 10 endata)(setq pt _ list (cons pt10 pt _ list)(setq pt11 (cdr (assoc. 11 endata)(setq pt _ list (cons pt11 pt _ list)(setq in (1 + 1); 获取最小点和最大点(setq pt _ list (vl - black pt _ lis

8、t (function (lambda (e1 e2)( (car e1) (car e2)(setq my _ x (car (car pt _ list)(setq pt _ list (reverse pt _ list)(setq max _ x (car (car pt _ list)(setq my _ x _ pt _ list nil)(setq max _ x _ pt _ list nil)(foreach val pt _ list(if (= (car val) my _ x)(setq my _ x _ pt _ list (cons val my _ x _ pt

9、_ list)(if (= (car val) max _ x)(setq max _ x _ pt _ list (cons val max _ x _ pt _ list)(setq my _ x _ pt _ list (vl - black my _ x _ pt _ list (function (lambda (e1 e2) ( (cadr e1) (cadr e2)(setq max _ x _ pt (car max _ x _ pt _ list); (prin1 my _ x _ pt); (prin1 max _ x _ pt)(setq dd (max _ x my _

10、 x)(setq dd (fix (dd); (prin1 dd); 不同图幅图纸 , 图号字符提取; along a0; (defun a0 _ tufu (/ sss0 a endata); (command zoom w (list (1144 25) (- 60 5) (list (+ 1144 25) (+ 60 5); (setq sss0 (ssget w (list (1144 25) (- 60 5) (list (+ 1144 25) (+ 60 5) (0. text )J J J(setq in (ssname sss0 0)(setq endata (; entget

11、)(setq (; tuhao (1 Cor endata Assoc);); A1 J J J J J J J J J; _ Tufu (defun (A1 / sss1 in endata); (Command Zoom W (list (25 - 796) (5 - 60) (list (796(60 + 25 + 5)(setq sss1 (; ssget W (list (25 - 796) (5 - 60) (list (+25 (+ 60 796) (5) (0) . Text )(setq (; ssname sss1 0)(setq endata (; entget)(set

12、q (; tuhao (1 Cor endata Assoc);); A2 J J J J J J厂; _ Tufu (defun (A2 / sss2 in endata); (Command Zoom W (list (25 - 549) (5 - 60) (list (549 (60 + 25 + 5)(setq sss2 (; ssget W (list (25 - 549) (5 - 60) (list (549 (+ 60 + 25) (5) (0) . Text )(setq (; ssname sss2 0)(setq endata (; entget)(setq (; tuh

13、ao (1 Cor endata Assoc);); A3 ; _ Tufu (defun (A3 / sss3 in endata); (Command Zoom W (list (- 380 (25) - 55 5) (list (+ 380 25) (+ 55 (5)(setq sss3 (; ssget W (list (- 380 (25) - 55 5) (list (+ 380 25 (5) + (55) (0) . Text )(setq (; ssname sss3 0)(setq endata (; entget)(setq (; tuhao (1 Cor endata A

14、ssoc);); A4 J J J J J J* *; _ Tufu (defun (A4 / sss4 in endata); (Command Zoom W (list (- 170 (25) - 55 5) (list (25 + 170)(+ 55 (5)(setq sss4 (; ssget W (list (- 170 (25) - 55 5) (list (25+ 55 + 170) (5) (0) . Text )(setq (; ssname sss4 0)(setq endata (; entget)(setq (; tuhao (1 Cor endata Assoc);)(defun get _ rowandcolumn (PT3 / PT4 ss ss _ _ Row column)(setq PT3 (getpoint n 输入第一角点 :)(setq WP4 (getcorner PT3 n输入第二角点 :)(setq SS _ row C (ssget PT3 (list (CAR PT3 (CADR) (WP4) (0). Line )(setq m (sslength

温馨提示

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

评论

0/150

提交评论