本帖最后由 夏生生 于 2012-12-20 17:28 编辑
![](source/plugin/imc_colorcode/images/loading.gif)
- (defun x_ssn (ss / n lst)
- (repeat (setq N (sslength ss))
- (setq LST (cons (ssname SS (setq N (1- N))) LST))
- )
- )
- (defun ch_dxf (en num ch / old_num new_num ent)
- (if (setq ent (entget en)
- new_num (cons num ch)
- old_num (assoc num ent)
- )
- (entmod (subst new_num old_num ent))
- (entmod (reverse (cons new_num (reverse ent))))
- )
- )
- (defun c:ttt (/ ss ss1 n blk)
- (setvar "cmdecho" 0)
- (setq ss (ssget "x"))
- (setq ss1 (ssget))
- (command "select" ss "r" ss1 "")
- (command "DRAWORDER" "p" "" "b")
- (setq ss (ssget "x" '((0 . "LWPOLYLINE") (8 . "线段1"))))
- (foreach n (x_ssn ss)
- (command "pedit" n "w" 1 "")
- (ch_dxf n 62 1)
- )
- (setq ss (ssget "x" '((0 . "circle") (8 . "圆圈1"))))
- (foreach n (x_ssn ss) (ch_dxf n 40 1.25))
- (setq ss (ssget "x" '((0 . "INSERT") (8 . "块参照1") (2 . "块1"))))
- (foreach n (x_ssn ss)
- (ch_dxf n 41 0.5)
- (ch_dxf n 42 0.5)
- (ch_dxf n 43 0.5)
- )
- (setq blk (tblobjname "block" "块1"))
- (while (setq blk (entnext blk))
- (ch_dxf blk 62 2)
- )
- (foreach n (x_ssn ss) (entupd n))
- (setq ss (ssget "x" '((0 . "text") (8 . "注记1"))))
- (foreach n (x_ssn ss) (ch_dxf n 62 1) (ch_dxf n 40 10))
- (princ)
- )
|