到目前为止,我有这个。只需要知道如何在一个命令中添加Lisp。
- ; Sets the color of everything in the drawing to 252 (Background Color)
- ; Revised 7/08/16 by Ian to include color options
- (defun chng ()
- (while (/= entname nil)
- (setq entlist (entget entname))
- (setq color (assoc 62 entlist))
- (if (/= color nil)
- (setq entlist (subst '(62 . 256) color entlist)))
- (entmod entlist)
- (setq entname (entnext entname))
- ))
- (defun C:111 ()
- (setq cc (getstring "Enter Client: (R=REDHAWK, Q=qwest, NA=New AT&T, OA=Old AT&T) Or type the color you want: "))
- ;; For VZW use 252, for Qwest use 150, for New AT&T use 9, for Old ATT use 7.
- (if (= cc "R") (setq cc "6"))
- (if (= cc "R") (setq cc "6"))
- (if (= cc "Q") (setq cc "150"))
- (if (= cc "q") (setq cc "150"))
- (if (= cc "NA") (setq cc "9"))
- (if (= cc "na") (setq cc "9"))
- (if (= cc "OA") (setq cc "7"))
- (if (= cc "oa") (setq cc "7"))
- (setq entname (entnext))
- (chng)
- (setq blk (cdr (assoc 2 (tblnext "BLOCK" T))))
- (if (/= blk nil)
- (progn
- (setq blks (list blk))
- (setq blk (cdr (assoc 2 (tblnext "BLOCK"))))
- (while (/= blk nil)
- (setq blks (cons blk blks))
- (setq blk (cdr (assoc 2 (tblnext "BLOCK"))))
- )
- )
- )
- (foreach blk blks
- (progn
- (princ blk)
- (setq entname (cdr (assoc -2 (tblsearch "BLOCK" blk))))
- (chng)
- )
- )
- (command "LAYER" "C" cc "*" "")
- )
|