CAD自动编号操作.doc_第1页
CAD自动编号操作.doc_第2页
CAD自动编号操作.doc_第3页
CAD自动编号操作.doc_第4页
CAD自动编号操作.doc_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

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

文档简介

CAD自动编号插件(含下载地址)修改浏览权限| 删除使用方法: 1.复制下面的文字到记事本,保存为 编号速写.lsp2.打开CAD,输入AP ,选择该文件,按加载,关闭窗口。3.输入SB ,启动插件。鼠标左键使用. 不会的可以去我的网盘下载,过期通知我。 下载地址:/file/f3b295eb78#编号速写.lsp =复制以下文字保存为=编号速写.lsp= ;参数初始化(defun chushihua() ;(setvar cmdecho 0) (setq bhlx 0) (write-line 编号类型:0) (setq bh0 0) (write-line 编号初值:1) (setq bh1 64) (setq bh2 0) (setq bh3 64) (setq yx Y) (write-line 引线:Y) (setq bklx Y) (write-line 边框:Y) (setq r 2.5) (setq zidong_r t) (write-line 边框圆半径:自动) (setq th 3.5) (write-line 文字高度:3.5) (setq ta 0) (write-line 文字旋转角度:0) (setq jl 1) (write-line 编号到引线距离:1) (setq jiantou 2.5) (write-line 箭头大小:2.5) (setq chang 5) (setq zidong_chang t) (write-line 水平段引线长度:自动) (setq qianzhui2 ) (write-line 自然数前缀:无) (setq houzhui2 ) (write-line 自然数后缀:无) (setq qianzhui3 ) (write-line 字母前缀:无) (setq houzhui3 ) (write-line 字母后缀:无) (setq pianyi 7) (write-line 边框自动处理时,文字到边框的偏移系数:7) )(chushihua);主函数*(defun c:sb(/ o ob) (defun er(str) (setvar osmode dx) (princ nSB已取消) ) (setq erod *error* *error* er) (if (= yx N) (progn (initget C Y K W H T) (setq ob (getpoint n指定编号位置编号初值(C)/引线(Y)/边框(K)/文字(W)/还原为默认设置(H)/退出(T):) (if (or (= ob C) (= ob Y) (= ob T) (= ob K) (= ob W) (= ob H) (= ob nil) (progn (if (= ob C) (chuzhi) (if (= ob Y) (yinxian) (if (= ob K) (bkshezhi) (if (= ob W) (wenzi) (if (= ob H) (chushihua) (if (= ob nil) (gaodu0) (if (= ob T) (exit) ) (progn (huitu o ob) ) ) ) (progn (initget C Y K W H T) (setq o (getpoint n指定标注位置编号初值(C)/引线(Y)/边框(K)/文字(W)/还原为默认设置(H)/退出(T):) (if (or (= o C) (= o Y) (= o T) (= o K) (= o W) (= o H) (= o nil) (progn (if (= o C) (chuzhi) (if (= o Y) (yinxian) (if (= o K) (bkshezhi) (if (= o W) (wenzi) (if (= o H) (chushihua) (if (= o nil) (gaodu0) (if (= o T) (exit) ) (progn (initget 1) (setq ob (getpoint o n指定编号位置:) (huitu o ob) ) ) ) );绘制过程*(defun huitu(o ob / dian1 dian2 dianx diany jiantou0 chang0) (graphscr) (setq jiantou0 jiantou) (command text (0 0) th ta 编号速写 erase (entlast) ) ;编号升序 ;0 (1 2 3.) 1 (a b c./A B C.) 2 (a1 a2./B1 B2.) 3 (aa ab ac./Ma Mb Mc.) (if (= bhlx 0) (progn (setq bh0 (+ bh0 1) (setq bh (itoa bh0) ) ) (if (= bhlx 1) (progn (setq bh1 (+ 1 bh1) (if ( bh1 122) (setq bh1 97) (if (and ( bh1 90) ( bh1 97) (setq bh1 65) (if ( bh1 65) (setq bh1 65) (if (and ( bh1 90) (setq bh1 97) (setq bh (chr bh1) ) ) (if (= bhlx 2) (setq bh (strcat qianzhui2 (itoa (setq bh2 (+ 1 bh2) houzhui2) ) (if (= bhlx 3) (progn (setq bh3 (+ 1 bh3) (if ( bh3 122) (setq bh3 97) (if (and ( bh3 90) ( bh3 97) (setq bh3 65) (if ( bh3 65) (setq bh3 65) (if (and ( bh3 90) (setq bh3 97) (setq bh (strcat qianzhui3 (chr bh3) houzhui3) ) ) (if (= bklx Y) ;边框半径是否自动处理及r0值 (progn (if (= zidong_r t) (setq r0 (/ (tdaxiao 3) 2) (setq r0 r) ) ) (setq r0 (/ (tdaxiao 2) 2) ) (if (= bklx J) ;边框为矩形时r0值 (if (= zidong_j t) (setq r0 (/ (tdaxiao 2) 2) (setq r0 (/ jgao 2) ) ) (if (= zidong_chang t) ;引线长度是否自动处理及chang0值 (progn (if (= bklx Y) (setq chang0 (* r0 2) (progn (if (= bklx J) (if (= zidong_j t) (setq chang0 (tdaxiao 1) (setq chang0 jkuan) ) (if (= bklx W) (setq chang0 (tdaxiao 1) ) ) ) ) ) (setq chang0 chang) ) ;对象捕捉 (setq dx (getvar osmode) (setvar osmode 0) (biankuangy r0 ob bh) (if (and (/= yx N) (/= yx n) (progn (if (= (car o) (car ob) (progn (setq dian1 (list(+ (car ob) (/ chang0 2) (- (cadr ob) r0 jl) (setq dian2 (list(- (car ob) (/ chang0 2) (- (cadr ob) r0 jl) (if ( jiantou0 (distance o dian1) (setq jiantou0 0) (setq dianx (+ (car o) (* (/ jiantou0 (distance o dian1) (- (car dian1) (car o) (setq diany (+ (cadr o) (* (/ jiantou0 (distance o dian1) (- (cadr dian1) (cadr o) (command pline o w 0 (/ jiantou0 3) (list dianx diany) w 0 0 dian1 dian2 ) ) (progn (setq dian1 (list(- (car ob) (/ chang0 2) (- (cadr ob) r0 jl) (setq dian2 (list(+ (car ob) (/ chang0 2) (- (cadr ob) r0 jl) (if ( jiantou0 (distance o dian1) (setq jiantou0 0) (setq dianx (+ (car o) (* (/ jiantou0 (distance o dian1) (- (car dian1) (car o) (setq diany (+ (cadr o) (* (/ jiantou0 (distance o dian1) (- (cadr dian1) (cadr o) (command pline o w 0 (/ jiantou0 3) (list dianx diany) w 0 0 dian1 dian2 ) ) ) ) ) ;对象捕捉 (setvar osmode dx) (setq *error* erod erod nil)(eval bh) ) ;参数设置*;初值设置(defun chuzhi(/ qianzhui20 houzhui20 qianzhui30 houzhui30) (initget 1 0 1 2 3) (setq bhlx (atoi (getkword 选择一种编号类型:n 自然数序列(1 2 3.) 字母序列(a b c./A B C.) 带前/后缀自然数序列(a1 a2./B1 B2./(1).) 带前/后缀字母序列(aa ab ac./Ma Mb Mc./(a).) 选择其中一种0/1/2/3:) (if (= bhlx 0) (progn (setq bh0 (getint n输入起始数值:) (if (= bh0 nil) (setq bh0 1) (setq bh0 (1- bh0) ) ) (if (= bhlx 1) (progn (setq bh1 (1- (ascii (getstring n输入起始字母:) ) ) (if (= bhlx 2) (progn (setq qianzhui20 (getstring (strcat 输入前缀:) (if (/= qianzhui20 ) (setq qianzhui2 qianzhui20) (setq bh2 (getint n输入起始数值:) (if (= bh2 nil) (setq bh2 1) (setq bh2 (1- bh2) (setq houzhui20 (getstring (strcat 输入后缀:) (if (/= houzhui20 ) (setq houzhui2 houzhui20) ) ) (if (= bhlx 3) (progn (setq qianzhui30 (getstring (strcat 输入前缀:) (if (/= qianzhui30 ) (setq qianzhui3 qianzhui30) (setq bh3 (1- (ascii (getstring n输入起始字母:) (setq houzhui30 (getstring (strcat 输入后缀:) (if (/= houzhui30 ) (setq houzhui3 houzhui30) ) ) (c:sb);引线设置(defun yinxian(/ yx0 yxf jl0 chang0 jiantou0) (initget Y N) (if (= yx Y) (setq yxf N) (setq yxf Y) (setq yx0 (getkword (strcat n 编号是否带引线?/:) (if (= yx0 nil) (setq yx yxf) (setq yx yx0) (if (= yx Y) (progn (setq jl0 (getdist (strcat 输入编号到引线的距离:) (if (/= jl0 nil) (setq jl jl0) (setq chang0 (getdist 输入水平段引线的长度:) (if (/= chang0 nil) (setq chang chang0 zidong_chang nil) (setq zidong_chang t) (setq jiantou0 (getdist (strcat 输入箭头大小:) (if (/= jiantou0 nil) (setq jiantou jiantou0) ) ) (c:sb);边框设置(defun bkshezhi(/ r0) (initget 1 Y W J) (setq bklx (getkword n选择边框类型圆(Y)/矩形(J)/无(W):) (if (= bklx Y) (progn (setq r0 (getdist (strcat 输入圆半径:) (if (/= r0 nil) (setq r r0 zidong_r nil) (setq zidong_r t) ) ) (if (= bklx J) (progn (setq jkuan (getdist n输入矩形宽:) (if (= jkuan nil) (setq zidong_j t) (progn (setq zidong_j nil) (setq jgao (getdist n输入矩形高度:) ) ) ) ) (c:sb);文字设置(defun wenzi(/ th0 ta0)(setq th0 (getdist (strcat 输入文字高度:) (if (/= th0 nil) (progn (setq th th0) ) ) (setq ta0 (getangle (strcat 输入文字角度:) (if (/= ta0 nil) (progn (setq ta ta0) (setq ta (* (/ ta pi) 180) ) )(c:sb) ;绘边框 (defun biankuangy(banjing yuanxin bianhao) (if (= bklx Y) (command circle yuanxin banjing) ) (if (= bklx J) (progn (if (= zidong_j t) (setq jkuan0 (tdaxiao 1) jgao0 (tdaxiao 2) (setq jkuan0 jkuan jgao0 jgao) ) (command pline) (com

温馨提示

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

评论

0/150

提交评论