(defun c:ct () (c:ct)
(princ))
(defun C:CT (/ p l n e os as ns st s nsl osl sl si chf chm cont)
(prompt “n>> Select text : ” )
(setq chm 0
p (ssget)) ; Select object-;s
(if p
(progn ; If any objects selecte-;d
(setq cont t)
(while cont
(setq osl (strlen
(setq os (hanKeystr nil “n>> Old string : ” ))))
(if (= osl 0)
(princ “Null input invalid” )
(setq cont nil)))
(setq nsl (strlen
(setq ns (hanKeystr nil “n>> New string : “))))
(setq l 0
n (sslength p))
(while (< l n) ; For each selected object..- ;.
(if (= “TEXT” ; Look for TEXT entity type (group 0- 😉
(cdr (assoc 0 (setq e (entget (ssname p l))))))
(progn (setq chf nil si 1)
(setq s (cdr (setq as (assoc 1 e))))
(while (= osl
(setq sl (strlen
(setq st (substr s si osl)))))
(if (= st os)
(progn (setq s (strcat (substr s 1 (1- si) ) ns (substr s (+ si osl))))
(setq chf t) ; Found old strin- ;g
(setq si (+ si nsl)))
(setq si
(1+ si))))
(if chf
(progn ; Substitute new string for ol- ;d
(setq e (subst (cons 1 s) as e ))
(entmod e) ; Modify the TEXT entit- ;y
(setq chm (1+ chm))))))
(setq l (1+ l)))))
(princ “n>> Changed… : ” ) ; Print total lines change- ;d
(princ chm)
(princ ” text lines.”)
(terpri))
기존에 2002 버전에서두 쓰던건데
이번에 2005 깔면서 ct 명령어 치면
error: no function definition: HANKEYSTR
이런 에러 메시지가 뜨네요.
ㅠ.ㅠ
어디가 틀렸는지 알려주세요
공유