写了前面一段再也写不去了,菜鸟就是菜鸟,搞不定这程序哪出了问题,请帮忙改一下吧, ;TEXT,MTEXT,DMINENSION改字高 (defun c:tc () (princ "Modify TEXT Height") (setvar "cmdecho" 0) (command "undo" "be") (setq ss (ssget '((0 . "TEXT,MTEXT,DIMENSION")))) (setq tt3 (ssadd) mm3 (ssadd) dd3 (ssadd) i 0) (while (< i (sslength ss)) ;这段结束就不对了 (if (= "TEXT" (cdr (assoc 0 (entget (ssname ss i))))) (ssadd (ssname ss i) tt3) ) (if (= "MTEXT" (cdr (assoc 0 (entget (ssname ss i))))) (ssadd (ssname ss i) mm3) ) (if (= "DMINENSION" (cdr (assoc 0 (entget (ssname ss i))))) (ssadd (ssname ss i) dd3) ) (setq i (+ i 1)) ) (setq i 0) (setq sst (ssname tt3 i) ssm (ssname mm3 i) ssd (ssname dd3 i)) (setq t0 (cdr(assoc 40 (entget sst)))) (setq m0 (cdr(assoc 40 (entget ssm)))) (setq d0 (cdr(assoc 40 (entget ssd)))) (princ (strcat "\n<" (itoa (sslength tt3)) " 个文字高度为" (rtos t0) ">" <" (itoa (sslength mm3)) " 个文字高度为" (rtos m0) ">" <" (itoa (sslength dd3)) " 个文字高度为" (rtos d0) ">" ) ) (initget (+ 2 4)) (setq th (getdist "\n请输入新的字高:")) (setq i 0) (repeat (sslength tt3) (setq si (ssname tt3 i)) (setq thc (entget si) thc (subst (cons 40 th) (assoc 40 thc) thc)) (entmod thc) (setq i (+ i 1)) ) (princ) )
|