1.计算所有线段总长度(加载后只需框选所有线段便可得出这些线段的总长度)
(defun c:LL ()
(setvar "cmdecho" 1)
(setq en (ssget (list '(0 . "spline,arc,line,ellipse,LWPOLYLINE"))))
(setq i 0)
(setq ll 0)
(repeat (sslength en)
(setq ll (+ dd ll))
)
)
2.标注所有线段(加载后只需框选所有线段便可得标注这些线段)
(defun c:LLL ()
(COMMAND "UCS" "")
(setvar "cmdecho" 1)
(SETVAR "OSMODE" 0)
(setq
)
;;选取需要测量的样条曲线、圆弧、直线、椭圆
(setq en (ssget (list '(0 . "spline,arc,line,ellipse,LWPOLYLINE"))))
(setq i 0)
;;获取系统参数textsize
(setq shh (getvar "textsize"))
(setq str_hh (strcat "n文字高度 <" (rtos shh 2) ">: "))
(setq hh (getdist str_hh))
(while hh
(setvar "textsize" hh)
(setq hh nil))
;;输入标注文字高度
;;循环开始
(repeat (sslength en)
#p#分页标题#e#
)
(prin1)
)
(prompt "n <>在图中直接写出长度")
(prin1)
3.连续打断程序
(defun c:br1 ()
)
4.将CAD文字导入Excel表格
(defun c:Q2()
(setq ffn (getfiled "写出文件" "" "xls" 1))
(princ "n选取文字...")
(setq ss (ssget))
(setq ff (open ffn "w"))
(setq i 0)
(repeat (sslength ss)
(setq ssn (ssname ss i))
(setq ssdata (entget ssn))
(setq sstyp (cdr (assoc 0 ssdata)))
(if (or (= sstyp "TEXT") (= sstyp "MTEXT"))
(progn
(setq txt (cdr (assoc 1 ssdata)))
(princ txt ff)
(princ "n" ff)
)
)
(setq i (1+ i))
)
(close ff)
(princ (strcat "n写出文件: " ffn))
(prin1)
)
5 删除带颜色图元
以下程序在别人的贴子里贴过.为了说明问题,今天再贴一次.
改颜色的LISP程序
(defun c:c1()(ssget)(command "chprop" "p" "" "c" "1" "") (princ))
(defun c:c2()(ssget)(command "chprop" "p" "" "c" "2" "") (princ))
(defun c:c3()(ssget)(command "chprop" "p" "" "c" "3" "") (princ))
(defun c:c4()(ssget)(command "chprop" "p" "" "c" "4" "") (princ))
(defun c:c5()(ssget)(command "chprop" "p" "" "c" "5" "") (princ))
(defun c:c6()(ssget)(command "chprop" "p" "" "c" "6" "") (princ))
(defun c:c7()(ssget)(command "chprop" "p" "" "c" "7" "") (princ))
(defun c:c8()(ssget)(command "chprop" "p" "" "c" "8" "") (princ))
你用C1 命令就可以将图元改为红色了.其余类似.
删除红色图元
(defun C:D1 (/ m A M)
这样,键入 D1 命令,就可以删除红色的图元了.
相关文章
- 2021-08-01Visual LISP程序设计(AutoCAD 2006)PDF下载
- 2021-07-30AutoCAD程序设计魔法书 [AutoLISP DCL基础篇]PDF下载
- 2021-07-15AutoCAD LISP VLISP函数库查询辞典PDF下载
- 2020-12-24AutoCAD 2004与AutoLISP二次开发技术PDF下载
- 2013-02-22键槽尺寸查询程序 不用安装可直接用
- 2012-05-24AutoCAD 2004与AutoLISP二次开发技术
- 2012-05-24AutoCAD LISP/VLISP函数库查询辞典
- 2012-05-13CAD2004鼠标中键双击Zoom-e去除补丁
- 2012-04-11CAD垃圾批量清理程序V2.5 免费版下载
- 2012-04-06CAD地形图矢量化后处理程序2.0绿色版