專門寫了一個程式autolisp程式,如果要分析文字內容的話,需要具體的dwg檔案及說明。程式程式碼如下:命令【TES】自己修改命令。
(defun c:tes ( / #g1 &k1 &kw1 &tr1 @n1 @n5) (setvar "cmdecho" 0) (setvar "blipmode" 0) (setvar "dimzin" 0) (if (null vlax-dump-object) (vl-load-com) ) (princ "\n請選擇要加倍數值的文字") (if (setq &kw1 (ssget "((0 . "text,mtext") (1 . "~*[~+-.0-9]*" ))) );選擇純數值文字 (progn (while (setq &k1 (ssname &kw1 0)) (setq &kw1 (ssdel &k1 &kw1)) (setq #g1 (entget &k1)) (setq &tr1 (cdr (assoc 1 #g1)) @n5 (strlen &tr1)) (if (setq @n1 (vl-string-search "." &tr1 0)) (setq @n1 (- @n5 @n1 1)) (setq @n1 0) ) (setq &tr1 (rtos (* 2 (atof &tr1)) 2 @n1)) (setq #g1 (subst (cons 1 &tr1) (assoc 1 #g1) #g1)) (entmod #g1) ) ) ) (princ))
專門寫了一個程式autolisp程式,如果要分析文字內容的話,需要具體的dwg檔案及說明。程式程式碼如下:命令【TES】自己修改命令。
(defun c:tes ( / #g1 &k1 &kw1 &tr1 @n1 @n5) (setvar "cmdecho" 0) (setvar "blipmode" 0) (setvar "dimzin" 0) (if (null vlax-dump-object) (vl-load-com) ) (princ "\n請選擇要加倍數值的文字") (if (setq &kw1 (ssget "((0 . "text,mtext") (1 . "~*[~+-.0-9]*" ))) );選擇純數值文字 (progn (while (setq &k1 (ssname &kw1 0)) (setq &kw1 (ssdel &k1 &kw1)) (setq #g1 (entget &k1)) (setq &tr1 (cdr (assoc 1 #g1)) @n5 (strlen &tr1)) (if (setq @n1 (vl-string-search "." &tr1 0)) (setq @n1 (- @n5 @n1 1)) (setq @n1 0) ) (setq &tr1 (rtos (* 2 (atof &tr1)) 2 @n1)) (setq #g1 (subst (cons 1 &tr1) (assoc 1 #g1) #g1)) (entmod #g1) ) ) ) (princ))