안녕하세요 캐드리습 질문입니다.
전에 이곳에서 받은 리습 같은데..
문제없이 잘 작동했었는데 어느 날 부터인가 작동하지 않습니다.
무엇이 문제인지 모르겠습니다.
명령어를 치면
첫번째 선택박스 까지는 문제 없이 진행되는데 바꾸고 싶은 스타일일 선택하고 나면
” Regenerating model. “
라고 뜨고서는 끝납니다.
유용하게 잘 쓰던 리습이 안 되니 답답하네요..
부탁드립니다.
—————————————————–
(defun c:tsc( / acdoc col styles style nlst )
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;;
;; Sub Function – 01 ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;;
(defun LM:GetAllItems ( collection / result ) (vl-load-com)
(vlax-for item collection (setq result (cons item result)))
(reverse result)
)
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;;
;; Sub Function – 02 ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;;
(defun LM:ListBox ( title data multiple / file tmp dch return )
(cond
(
(not
(and (setq file (open (setq tmp (vl-filename-mktemp nil nil “.dcl”)) “w”))
(write-line
(strcat
“listbox : dialog { label = ””
title
“”; spacer; : list_box { key = ”list”; multiple_select = “
(if multiple “true” “false”)
“; } spacer; ok_cancel;}”
)
file
)
(not (close file)) (< 0 (setq dch (load_dialog tmp))) (new_dialog “listbox” dch)
)
)
)
(
t
(start_list “list”)
(mapcar ‘add_list data) (end_list)
(setq return (set_tile “list” “0”))
(action_tile “list” “(setq return $value)”)
(setq return
(if (= 1 (start_dialog))
(mapcar ‘(lambda ( x ) (nth x data)) (read (strcat “(” return “)”)))
)
)
)
)
(if (< 0 dch) (unload_dialog dch))
(if (setq tmp (findfile tmp)) (vl-file-delete tmp))
return
)
;;==========================================;;
;; Main Function ;;
;;==========================================;;
(setq acdoc (vla-get-ActiveDocument(vlax-get-acad-object))
col (vla-get-textstyles acdoc)
styles (LM:GetAllItems col)
)
(setq nlst (mapcar ‘(lambda ( x ) (vla-get-name x)) styles)
style (car(LM:ListBox “Select Style…” nlst nil))
)
(vlax-for blk (vla-get-Blocks acdoc)
(vlax-for obj blk
(and (wcmatch (vla-get-ObjectName obj) “AcDb*Text” )
(vla-put-stylename obj style)
)
)
)
(vla-Regen acdoc acAllViewports)
(setvar ‘textstyle style)
(setvar ‘dimtxsty style)
(princ)
)(vl-load-com)
작동이 잘 되나요.. TT