1.CAD显示与隐藏快捷命令---Lisp代码分享(2)
2.CAD的字字体长度统计LISP代码是什么
3.谁能帮我写个cad的lisp程序?
CAD显示与隐藏快捷命令---Lisp代码分享(2)
运用Lisp编写几个简便的CAD快捷命令,这些命令将选择相似对象与隔离功能整合,体宋体将多步骤操作简化为一步完成。宋体同时,下载龙头启动指标源码将图层管理命令整合在一起,字字体增强操作效率。体宋体电影源码有哪些附上完整命令集及其源代码,宋体方便用户学习与交流。下载为便于查阅,字字体前两篇Lisp相关文章也一并提供。体宋体文章分为三部分:第一部分介绍命令功能,宋体第二部分展示Lisp源代码,下载第三部分说明如何加载与使用这些自定义命令。字字体吸粉电影源码文章建议用户在记事本中编辑代码,体宋体并将其另存为my.lsp文件。宋体如果需要运行这些命令,ssr拨号源码只需在CAD命令行中输入AP,然后选择Lisp文件,成功加载后即可使用。以太猫源码 前端对常使用的命令,可将其添加到启动组中以快速访问。为方便获取完整程序文件,用户可通过关注公众号并回复"Lisp"获取下载链接。后续制作的Lisp命令也会集中在这个文件夹内共享。
CAD的长度统计LISP代码是什么
defun C:ZCD (/ CURVE TLEN SS N SUMLEN)(vl-load-com)
(setq SUMLEN 0)
(setq SS (ssget '((0 . "CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE,ARC"))))
(setq N 0)
(repeat (sslength SS)
(setq CURVE (vlax-ename->vla-object (ssname SS N)))
(setq TLEN (vlax-curve-getdistatparam
CURVE
(vlax-curve-getendparam CURVE)
)
)
(setq SUMLEN (+ SUMLEN TLEN))
(setq N (1+ N))
)
(print (strcat "总长度: " (rtos SUMLEN 2 5)))
(princ)
)
命令可以自己改。
这有下载
谁能帮我写个cad的lisp程序?
;矩形中心线
(defun c:jxzxx()
(setq cmd (getvar "cmdecho"))
(setq osm (getvar "osmode"))
(setvar "cmdecho" 0)
(command "undo" "be")
(If (progn
(princ "请选取矩形:")
(setq ssa (ssget":S" '((0 . "lwpolyline") ( . 4) ( . 1))))
)
(progn
(setq dxf (entget (ssname ssa 0)))
(setq pts (mapcar 'cdr (vl-remove-if '(lambda(x)(/= (car x) )) dxf)))
(setq p1 (apply 'mapcar (cons 'min pts)))
(setq p3 (apply 'mapcar (cons 'max pts)))
(setq p2 (list (car p3) (cadr p1)))
(setq p4 (list (car p1) (cadr p3)))
(setq pm1 (mapcar '(lambda(a b)(* 0.5 (+ a b))) p1 p4))
(setq pm2 (mapcar '+ pm1 '(5 0)))
(setq pm1 (mapcar '(lambda(a b)(* 0.5 (+ a b))) p1 p2))
(setq pm2 (mapcar '+ pm1 '(0 5)))
(setq pm1 (mapcar '(lambda(a b)(* 0.5 (+ a b))) p2 p3))
(setq pm2 (mapcar '+ pm1 '(-5 0)))
(setq pm1 (mapcar '(lambda(a b)(* 0.5 (+ a b))) p3 p4))
(setq pm2 (mapcar '+ pm1 '(0 -5)))
(setvar "osmode" 0)
(mapcar '(lambda(pts)
(command "_line" (car pts) (cadr pts) "" "_chprop" (entlast) "" "c" 1 "")
)
(list (list pm1 pm2)
(list pm1 pm2)
(list pm1 pm2)
(list pm1 pm2)
)
)
(setq i 1)
(mapcar '(lambda(pt dxy)
(setq pt1 (mapcar '+ pt dxy))
(if (or (= i 1) (= i 3)
(command "_Circle" pt1 1.5 "_chprop" (entlast) "" "c" 6 "")
(progn
(command "_Circle" pt1 1. "_chprop" (entlast) "" "c" 1 "")
(command "_Circle" pt1 1. "_chprop" (entlast) "" "c" 1 "")
)
)
(setq i (1+ i))
)
(list p1 p2 p3 p4)
(list '(8 8) '(-8 8) '(-8 -8) '(8 -8))
)
)
)
(command "undo" "e")
(setvar "osmode" osm)
(setvar "cmdecho" cmd)
(princ)
)