;;复制标注,移动标注,改变标注的图层,skydie,20061209 (defun c:sdim () (princ "\n请选取对象...") (setq kk (ssget)) (setq n(sslength kk)) (setq k 0 f (ssadd) kkk 0) (repeat n (setq ee (ssname kk k)) (setq en (entget ee)) (setq dd (cdr (assoc 0 en))) (if (= dd "DIMENSION") (progn (setq f (ssadd ee f)) (setq kkk (1+ kkk)) ) ) (setq k (1+ k)) ) (if (> kkk 0) (progn (initget "c C m M L l") (setq tt (getkword "\n复制(c),移动(m),改变图层(1),<Enter默认为复制>:")) (if (= tt nil ) (setq tt "C" )) (setq tt (strcase tt)) (cond (( = tt "C") (command "copy" f "" pause pause)) (( = tt "M") (command "move" f "" pause pause)) (( = tt "L") (progn (setq newla (getstring "\n输入新图层名:")) (setq chklay (tblsearch "layer" newla)) (if (= chklay nil) (command "layer" "n" newla "c" "5" newla "Lw" "0.1" newla "" )) (command "chprop" f "" "LA" newla "") ) ) ) ) (alert" 警告:没有标注尺寸!") ) (princ) )
|