이 프로그램 만드신 분께는 정말 함부로 올려서 죄송합니다.
어떤 분이 만드신 건지 잘 몰라서요…
이거 안되요. 왜 안되는지 아시면 좀 알려 주세요.
;;===================================================================
;; pline을 따라가며 글자를 써 주는 프로그램…
;;===================================================================
(defun C:PPT (/ dcl_id txtcfg what_n o_tsz d_text)
(short-message “t_pt”)
(bgnerr)
(setq o_tsz (rtos (getvar “TEXTSIZE”) 2 2))
(setq txtcfg (strcat cfgpath “\T_TEXT.CFG”))
(setq d_text (ini_getitem txtcfg “PLINE TEXT” “TextSubstance” “InerCAD is Very Technical Architectural Program.”))
(setq o_tsz (ini_getitem txtcfg “PLINE TEXT” “TextSize” o_tsz))
(setq o_tsz (atof o_tsz))
(setq dcl_id (dload_dialog “t_text”))
(if (not (new_dialog “ptext” dcl_id))(exit))
(set_tile “text” d_text)
(mode_tile “text” 2)
(action_tile “text” “(setq d_text $value)”)
(action_tile “accept” “(done_dialog 1)”)
(action_tile “cancel” “(done_dialog 0)”)
(setq what_n (start_dialog))
(if (= what_n 1)(@ptxt_do))
(enderr)
)
;;————————————————————————-
(defun @ptxt_do (/ ent ent_pt ent_nm ety tsz @lstnt pl_vtx leng count tsub
@total cnt slng enm inp firt scond txt_ang y_n)
(setq ent (entsel “n>> Polyline을 선택하세요: “))
(if ent
(progn
(command “undo” “group”)
(setq ent_pt (cadr ent)) ; (cdr ent)일 경우 -> ((1.0 .1.0 0.0))
(setq ent_nm (car ent))
(setq ety (dxf 0 (entget ent_nm)))
(if (or (= ety “POLYLINE”)(= ety “LWPOLYLINE”))
(progn
(setq leng (strlen d_text))
(setq tsz (getdist (strcat “n>> Text의 크기<" (@@rtos o_tsz) ">: “)))
(if (not tsz)(setq tsz o_tsz)(setq o_tsz tsz))
(if o_tsz (ini_setitem txtcfg “PLINE TEXT” “TextSize” (rtos o_tsz 2 1)))
(if d_text (ini_setitem txtcfg “PLINE TEXT” “TextSubstance” d_text))
(initget “Y N”)
(setq y_n “n>> Polyline을 Spline처리 하시겠습니까?
(setq y_n (getkword y_n))
(if (or (not y_n) (= y_n “Y”))
(command “pedit” ent_nm “s” “x”)
)
(setvar “osmode” 0)
(command “point” “0,0,0”)
(setq @lstnt (entlast))
(entdel @lstnt)
(command “divide” ent (+ leng 1))
(setq @total (ssadd))
(while (setq @lstnt (entnext @lstnt))
(setq @total (ssadd @lstnt @total))
)
(setq cnt 0 slng (sslength @total) pl_vtx ‘())
(while (< cnt slng)
(setq enm (ssname @total cnt))
(setq inp (@@dxf 10 enm))
(setq pl_vtx (append pl_vtx (list inp)))
(setq cnt (1+ cnt))
)
(command “erase” @total “”)
(setq firt T count 0)
(while firt
(setq stxt (substr d_text (+ count 1) 1))
(setq firt (nth count pl_vtx))
(if firt
(progn
(setq scond (nth (+ 1 count) pl_vtx))
(if (not scond)
(setq scond (polar firt txt_ang 10))
)
(setq txt_ang (angle firt scond))
(setq tsub (ascii stxt))
(if (> tsub 127)
(progn
(setq stxt (substr d_text (+ count 1) 2))
(setq count (1+ count))
)
)
(command “text” firt tsz (rtd txt_ang) stxt)
)
)
(setq count (1+ count))
)
; (entdel ent_nm) ; 아직은 지우지 말자.
);progn..
(princ “n..Polyline이 아닙니다.”)
);if..
(command “redraw”)
(command “undo” “end”)
)
(not_ent)
)
)