本帖最后由 ZZXXQQ 于 2014-8-4 07:52 编辑
是否对每个图元都提示呢?下面是所有图元都一致的程序- (defun c:cs( )
- (setvar "cmdecho" 0)
- (setq dlq '("16" "20" "25" "32" "40" "50"))
- (setq xj '("2.5" "4" "6" "10" "16" "16"))
- (setq gj '("20" "20" "20" "25" "32" "32"))
- (setq 1gj '("20" "20" "20" "25" "32" "32"))
- (initget "JDG SC" 1)
- (setq gx (getkword "\n选择管型: "))
- (setq pp (if (= gx "JDG") "34" "XL"))
- (prompt "\n选择文字:")
- (setq ss (ssget '((0 . "TEXT"))))
- (repeat (setq i (sslength ss))
- (setq en (entget(ssname ss (setq i (1- i)))))
- (setq zb (cdr(assoc 10 en)));坐标
- (setq tx (cdr(assoc 1 en)))
- (if (setq dl (member tx dlq)) (progn
- (setq n (- (length dlq) (length dl)))
- (setq txt (strcat "BV-3*" (nth n xj) gx (nth n gj)));SC和JDG希望能选择
- (setq newzb (mapcar '- zb '(600 0 0)))
- (setq en (subst (cons 1 txt) (assoc 1 en) en))
- (entmake (cdr(subst (cons 10 newzb) (assoc 10 en) en)))
- (setq txt1 (strcat pp (nth n 1gj)));“34”处为输入的断路器名
- (setq newzb1 (mapcar '- zb '(1000 100 0)))
- (setq en (subst (cons 1 txt1) (assoc 1 en) en))
- (entmake (cdr(subst (cons 10 newzb1) (assoc 10 en) en)))
- ))
- )
- (setvar "cmdecho" 1)
- (princ)
- )
|