最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

lisp命令

来源:动视网 责编:小OO 时间:2025-10-04 08:12:03
文档

lisp命令

(defunc:rt()(command"rotate"))旋转作者:翁政(defunc:ff()(command"offset"))偏移(defunc:v()(command"move"))移动(defunc:g()(command"line"))直线(defunc:gg()(command"pline"))多线(defunc:q()(command"bhatch""p""s"))实体填充(defunc:cc()(command"copy"))复制(defunc:c()(command"ci
推荐度:
导读(defunc:rt()(command"rotate"))旋转作者:翁政(defunc:ff()(command"offset"))偏移(defunc:v()(command"move"))移动(defunc:g()(command"line"))直线(defunc:gg()(command"pline"))多线(defunc:q()(command"bhatch""p""s"))实体填充(defunc:cc()(command"copy"))复制(defunc:c()(command"ci
(defun c:rt ()(command "rotate"))旋转 作者:翁政

(defun c:ff ()(command "offset"))偏移

(defun c:v ()(command "move"))移动

(defun c:g ()(command "line"))直线

(defun c:gg ()(command "pline"))多线

(defun c:q ()(command "bhatch" "p" "s"))实体填充

(defun c:cc ()(command "copy"))复制

(defun c:c ()(command "circle"))圆

(defun c:a ()(command "arc"))圆弧

(defun c:f ()(command "fillet"))圆角

(defun c:dt ()(command "dtext"))文字编辑

(defun c:t ()(command "text"))文字

(defun c:sc ()(command "scale"))比例缩放

(defun c:tr ()(command "trim"))修剪

(defun c:x ()(command "explode"))分解

(defun c:ar ()(command "array"))陈列

(defun c:e ()(command "_erase"))删除

(defun c:cc1 ()(command "copy" "l" "" "@"))连续复制

(defun c:www ()(command "_browser"))用IC连机,DOS调用内部命令

(defun c:w ()(command "matchprop"))

(defun c:d ()(command "_TXTALIGN"))对齐文字

(defun c:dq ()(command "_dimaligned"))对齐标注

(defun c: ()(command ""))

(defun c: ()(command ""))

-

1.先选择弧,就可求得弧的半径和弧圆心的坐标。

2.选择p2点,(setvar "osmode" 1)扑捉端点 就可计算出p2到弧圆心的距离(d),用 d (distance p2 pp1)

3.计算出你要园圆的半径。r1 (- d r)

4.画圆,先要关闭扑捉端点(setvar "osmode" 0) 画圆(command "circle" p2 r1)

(defun c:hy ()

(prompt "选择弧:")

(setq en (entget (car (entsel))) r (cdr (assoc 40 en)) pp1 (cdr (assoc 10 en)))

(prompt "选择p2点:")

(setvar "osmode" 1)

(setq p2 (getpoint) d (distance p2 pp1) r1 (- d r))

(setvar "osmode" 0)

(command "circle" p2 r1)

)

(defun c:cpro()

(prompt "选择要旋转的目标:")

(setq en (ssget))

(setq p1 (getpoint "\

输入基点: "))

(command "copy" en "" p1 p1)

(command "rotate" en ""p1 (getreal "转动的角度:"))

)

;;数字1

(defun C:1 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为红色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "1" ""))

(princ "\

OK")

(princ)

);end defun C:1

;;数字2

(defun C:2 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为黄色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "2" ""))

(princ "\

OK")

(princ)

);end defun C:2

;;数字3

(defun C:3 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为绿色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "3" ""))

(princ "\

OK")

(princ)

);end defun C:3

;;数字4

(defun C:4 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为青色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "4" ""))

(princ "\

OK")

(princ)

);end defun C:4

;;数字5

(defun C:5 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为蓝色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "5" ""))

(princ "\

OK")

(princ

)

);end defun C:5

;;数字6

(defun C:6 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为紫色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "6" ""))

(princ "\

OK")

(princ)

);end defun C:6

;;数字7

(defun C:7 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为白色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "7" ""))

(princ "\

OK")

(princ)

);end defun C:7

;;数字8

(defun C:8 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为深灰色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "8" ""))

(princ "\

OK")

(princ)

);end defun C:8

;;数字9

(defun C:9 ( / gp)

(setvar "cmdecho" 0)

(princ "\

★改变对象颜色为灰色★")

(setq gp (ssget))

(if (/= gp nil) (command ".change" gp "" "p" "c" "9" ""))

(princ "\

OK")

(princ)

);end defun C:9

[code]

(defun c:tk()

(command "layer" "c" 9 "0" "lw" 0.3 "0"

"m" "中心线" "c" 1 "" "l" "center" "" "lw" 0.09 ""

"m" "虚线" "c" 4 "" "l" "acad_iso02w100" "" "lw" 0.09 ""

"m" "标注" "c" "blue" "" "lw" 0.09 ""

"m" "细实线" "c" "6" "" "lw" 0.09 ""

"s" "0" "")

(command "style" "s3" "仿宋_gb2312" "3.5" "0.67" "0" "n" "n" "n" "")

(command "style" "s5" "仿宋_gb2312" "5" "0.67" "0" "n" "n" "n" "")

(command "style" "s7" "仿宋_gb2312" "7" "0.67" "0" "n" "n" "n" "")

(setq c_time (menucmd "m=$(edtime,$(getvar,date),yyyymodd)"))

(command "osnap" "off")

(setq tuhao(getint"请输入图号a0(横)-10,a0(竖)-20以此类推"))

(setq inspoint(getpoint"请输入图框左下角的插入点"))

(if (or (= tuhao 10) (= tuhao 20))

(setq l1 11 l2 841))

(if (or (= tuhao 11) (= tuhao 21))

(setq l1 841 l2 594))

(if (or (= tuhao 12) (= tuhao 22))

(setq l1 594 l2 420))

(if (or (= tuhao 13) (= tuhao 23))

(setq l1 420 l2 297))

(if (or (= tuhao 14) (= tuhao 24))

(setq l1 297 l2 210))

(if (>= tuhao 20)

(setq temp1 l1

l1 l2

l2 temp1)

)

(if (or(= tuhao 13) (= tuhao 23)(= tuhao 14)(= tuhao 24))

(setq bju 5)(setq bju 10))

(setq x1(list (+ (car inspoint)25) (+ (cadr inspoint)bju)))

(setq x2 (list (+ (car inspoint)(- l1 bju)) (+ (cadr inspoint)bju)))

(setq x3 (polar x2 (* pi 0.5) (- l2 (* 2 bju))))

(setq ins2 (list (+ (car inspoint) l1) (+ (cadr inspoint) l2)))

(setq bl11 (polar x2 pi 180)

bl12 (polar bl11 0 12)

bl13 (polar bl12 0 12)

bl14 (polar bl13 0 16)

bl15 (polar bl14 0 12)

bl16 (polar bl15 0 12)

bl17 (polar bl16 0 16)

)

(setq bl21 (polar bl11 (* pi 0.5) 7)

bl22 (polar bl21 0 12)

bl23 (polar bl22 0 12)

bl24 (polar bl23 0 16)

bl25 (polar bl24 0 12)

bl26 (polar bl25 0 12)

bl27 (polar bl26 0 16)

)

(setq bl31 (polar bl21 (* pi 0.5) 7)

bl32 (polar bl31 0 12)

bl33 (polar bl32 0 12)

bl34 (polar bl33 0 16)

bl35 (polar bl34 0 12)

bl36 (polar bl35 0 12)

bl37 (polar bl

36 0 16)

)

(setq bl41 (polar bl31 (* pi 0.5) 7)

bl42 (polar bl41 0 12)

bl43 (polar bl42 0 12)

bl44 (polar bl43 0 16)

bl45 (polar bl44 0 12)

bl46 (polar bl45 0 12)

bl47 (polar bl46 0 16)

)

(setq bl51 (polar bl41 (* pi 0.5) 7)

bl52 (polar bl51 0 12)

bl53 (polar bl52 0 12)

bl54 (polar bl53 0 16)

bl55 (polar bl54 0 12)

bl56 (polar bl55 0 12)

bl57 (polar bl56 0 16)

)

(setq bl61 bl51

bl62 (polar bl61 0 10)

bl63 (polar bl62 0 10)

bl (polar bl63 0 16)

bl65 (polar bl 0 16)

bl66 (polar bl65 0 12)

bl67 (polar bl66 0 16)

)

(setq bl71 (polar bl61 (* pi 0.5) 7)

bl72 (polar bl71 0 10)

bl73 (polar bl72 0 10)

bl74 (polar bl73 0 16)

bl75 (polar bl74 0 16)

bl76 (polar bl75 0 12)

bl77 (polar bl76 0 16)

)

(setq bl81 (polar bl71 (* pi 0.5) 7)

bl82 (polar bl81 0 10)

bl83 (polar bl82 0 10)

bl84 (polar bl83 0 16)

bl85 (polar bl84 0 16)

bl86 (polar bl85 0 12)

bl87 (polar bl86 0 16)

)

(setq bl91 (polar bl81 (* pi 0.5) 7)

bl92 (polar bl91 0 10)

bl93 (polar bl92 0 10)

bl94 (polar bl93 0 16)

bl95 (polar bl94 0 16)

bl96 (polar bl95 0 12)

bl97 (polar bl96 0 16)

)

(setq bl101 (polar bl91 (* pi 0.5) 7)

bl102 (polar bl101 0 10)

bl103 (polar bl102 0 10)

bl104 (polar bl103 0 16)

bl105 (polar bl104 0 16)

bl106 (polar bl105 0 12)

bl107 (polar bl106 0 16)

)

(setq bm16 (polar bl17 0 50))

(setq bm21 (polar bl17 (* pi 0.5) 9)

bm22 (polar bm21 0 6.5)

bm23 (polar bm22 0 6.5)

bm24 (polar bm23 0 6.5)

bm25 (polar bm24 0 6.5)

bm26 (polar bm25 0 12)

bm27 (polar bm26 0 12)

)

(setq bm31 (polar bm21 (* pi 0.5) 9)

bm32 (polar bm31 0 6.5)

bm33 (polar bm32 0 6.5)

bm34 (polar bm33 0 6.5)

bm35 (polar bm34 0 6.5)

bm36 (polar bm35 0 12)

bm37 (polar bm36 0 12)

)

(setq bm41 bl57

bm45 (polar bm41 0 26)

bm46 (polar bm45 0 12)

bm47 (polar bm46 0 12)

)

(setq bm18 (polar bm16 0 50)

bm28 (polar bm18 (* pi 0.5) 18)

bm48 (polar bm37 (* pi 0.5) 20)

bm49 (polar bm48 0 50)

bm50 (polar bm48 (* pi 0.5) 18)

bm51 (polar bm50 0 50)

)

(command "osnap" "off")

(command "rectang" x1 x3)

(command "line" bl12 bl52 ""

"line" bl13 bl53 ""

"line" bl14 bl54 ""

"line" bl15 bl55 ""

"line" bl16 bl56 ""

"line" bl17 bl107 ""

"line" bm16 bm50 ""

"line" bm25 bm45 ""

"line" bm26 bm46 ""

)

(command "line" bl11 bl101 ""

"line" bl62 bl102 ""

"line" bl63 bl103 ""

"line" bl bl104 ""

"line" bl65 bl105 ""

"line" bl66 bl106 ""

)

(command "line" bl101 bm51 ""

"line" bl71 bl77 ""

"line" bl51 bm47 ""

"line" bl41 bl47 ""

"line" bm48 bm49 ""

"line" bm31 bm28 ""

"line" bm21 bm27 ""

)

(command "layer" "s" "标注" "")

(command "rectang" inspoint ins2)

(command "line" bl91 bl97 ""

"line" bl81 bl87 ""

"line" bl21 bl27 ""

"line" bl31 bl37 ""

"line" bm22 bm32 ""

"line" bm23 bm33 ""

"line" bm24 bm34 ""

)

(command "style" "s3" "" "" "" "" "" "" "")

(comm

and "mtext" bl11 "j" "mc" bl22 "工艺" ""

"mtext" bl21 "j" "mc" bl32 "审核" ""

"mtext" bl31 "j" "mc" bl42 "cad" ""

"mtext" bl41 "j" "mc" bl52 "设计" ""

"mtext" bl21 "j" "mc" bl32 "审核" ""

"mtext" bl61 "j" "mc" bl72 "标记" ""

"mtext" bl62 "j" "mc" bl73 "处数" ""

"mtext" bl63 "j" "mc" bl74 "分区" ""

"mtext" bl "j" "mc" bl75 "更改文件号" ""

"mtext" bl65 "j" "mc" bl76 "签名" ""

"mtext" bl66 "j" "mc" bl77 "年、月、日" ""

"mtext" bl14 "j" "mc" bl25 "批准" ""

"mtext" bl44 "j" "mc" bl55 "标准化" ""

"mtext" bl32 "j" "mc" bl43 "周 杨" "";改成你自己的大名就ok了

"mtext" bl33 "j" "mc" bl44 c_time ""

"mtext" bm31 "j" "mc" bm45 "阶段标记" ""

"mtext" bm35 "j" "mc" bm46 "重量" ""

"mtext" bm36 "j" "mc" bm47 "比例" ""

"mtext" bl17 "j" "mc" bm27 "共 张  第 张" ""

"mtext" bm26 "j" "mc" bm37 "1:1" ""

)

(command "style" "s5" "" "" "" "" "" "" "")

(command "mtext" bm41 "j" "ml" bm50 "材料:" ""

"mtext" bm48 "j" "mc" bm51 "湖南省湘维公司" ""

"mtext" bm16 "j" "mc" bm28 "(图样代号)" ""

)

(command "mtext" bm37 "j" "mc" "s" "s7" bm49 "图样名称" "")

(command "style" "s3" "" "" "" "" "" "" "")

(command "osnap" "end,mid,int,cen,per")

(princ)

)

[/code]

下面是粗糙度符号代码:

[code]

(defun c:cu()

(command "osnap" "nea");设置捕捉模式为捕捉最近点

(setq a1 (getpoint"请用鼠标点取插入点:"));用鼠标获取插入点

(command "osnap" "off")关闭捕捉模式

(setq bb(getpoint "请用鼠标选择插入方向,"));确定插入方向,与待标示表面垂直

(setq an1 (angle a1 bb));定义角度an1,该角度为x轴与插入方向的夹角

(setq ot1 (getvar "orthomode"));获取正交模式的值

;如果正交模式打开,则更改方向,使之处于正交方向

(if (and (= ot1 1) (or (> an1 (* pi 1.75)) (< an1 (* pi 0.25)))) (setq an1 (* pi 0)) )

(if (and (= ot1 1)(> an1 (* pi 0.25)) (< an1 (* pi 0.75))) (setq an1 (* pi 0.5)) )

(if (and (= ot1 1)(> an1 (* pi 0.75)) (< an1 (* pi 1.25))) (setq an1 (* pi 1)) )

(if (and (= ot1 1)(> an1 (* pi 1.25)) (< an1 (* pi 1.75))) (setq an1 (* pi 1.5)) )

;画线

(setq an2 (- an1 (/ pi 2)))

(setq a2 (polar a1 (+ (/ pi 3) an2) 5))

(setq a3 (polar a1 (+ (/ pi 3) an2) 12))

(setq a4 (polar a2 (+ pi an2) 5))

(setq a5 (polar a2 an1 3))

(setq a6 (polar a4 an1 3))

(command "line" a1 a3 ""

"line" a1 a4 ""

"line" a2 a4 "")

;文字标示

(if (<= an1 (* pi 1.25))

(command "mtext" a4 "h" "2.5" "j" "mc" "r" a2 a5 "6.3" ""))

(if (> an1 (* pi 1.25))

(command "mtext" a2 "h" "2.5" "j" "mc" "r" a4 a6 "6.3" ""))

(command "osnap" "end,mid,int,cen,per")

)

[/code]

文档

lisp命令

(defunc:rt()(command"rotate"))旋转作者:翁政(defunc:ff()(command"offset"))偏移(defunc:v()(command"move"))移动(defunc:g()(command"line"))直线(defunc:gg()(command"pline"))多线(defunc:q()(command"bhatch""p""s"))实体填充(defunc:cc()(command"copy"))复制(defunc:c()(command"ci
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top