텍스트 뒤에 붙이기 말고 수정했으면합니다.
컨텐츠 정보
- 287 조회
- 4 댓글
- 0 추천
- 0 비추천
- 목록
본문
텍스트 뒤에 붙이기 말고 전체 바꾸기 했으면합니다.
(defun c:TxtUpdate ( / *error* _read
dcfilename strfilename strlst ss dctag ptr dcflag str )
;; © Lee Mac 2010
(setq dcfilename “txtUpdate.dcl” ;; DCL Filename
Strfilename “txtUpdate.txt” ;; Data Filename
)
(defun *error* ( msg )
(and dcTag (unload_dialog dcTag))
(or (wcmatch (strcase msg) “*BREAK,*CANCEL*,*EXIT*”)
(princ (strcat “\n** Error: ” msg ” **”)))
(princ))
(defun _read ( file / ofile lst nl )
(cond ( (setq ofile (open file “r”))
(while (setq nl (read-line ofile))
(setq lst (cons nl lst)))
(close ofile)))
(reverse lst)
)
(cond ( (not (setq Strfilename (findfile Strfilename)))
(princ “\n** Data File not Found **”))
( (not (setq StrLst (_read Strfilename)))
(princ “\n** Data File Empty **”))
( (not (setq ss (ssget “_:L” ‘((0 . “*TEXT”))))))
( (<= (setq dcTag (load_dialog dcfilename)) 0)
(princ “\n** Dialog Definition Not Found **”))
( (not (new_dialog “txtupdate” dcTag))
(princ “\n** Dialog Could not be Loaded **”))
(t
(start_list “lst”)
(mapcar (function add_list) StrLst)
(end_list)
(set_tile “dcltitle” “Text Notes”)
(setq ptr (set_tile “lst” “0”))
(action_tile “lst” “(setq ptr $value)”)
(setq dcFlag (start_dialog) dcTag (unload_dialog dcTag) Str (nth (atoi ptr) StrLst))
(if (= 1 dcFlag)
(
(lambda ( i / ent )
(while (setq ent (ssname ss (setq i (1+ i))))
(entupd
(cdr
(assoc -1
(entmod
(subst (cons 1 (strcat (cdr (assoc 1 (entget ent))) str)) (assoc 1 (entget ent)) (entget ent))
)
)
)
)
)
)
-1
)
(princ “\n*Cancel*”)
)
)
)
(princ)
)
아래로 파일 올립니다.