글자를 세로로 정렬하는 리습입니다…..
자꾸 에러가 나는것 같아서 어디가 문제인지 좀 봐주시면…
(defun c:tav(/ ents nent ans w72 xpnt count ent old10 old11 old72 new10 new11 new72)
(setq ents (ssget ‘((-4 . “
(setq nent (sslength ents))
(setq ans (getstring “n>>
(cond
((= ans “L”) (setq w72 0))
((= ans “C”) (setq w72 1))
((= ans “R”) (setq w72 2))
) ;of cond
(setq xpnt (getpoint “n>>Pick Point… : “))
(setq count 0)
(repeat nent
(setq ent (entget (ssname ents count)))
(setq old10 (assoc 10 ent))
(setq old11 (assoc 11 ent))
(setq old72 (assoc 72 ent))
(setq new10 (cons 10 (list (car xpnt) (cadr (cdr old10)))))
(setq new11 (cons 11 (list (car xpnt) (cadr (cdr old11)))))
(setq new72 (cons 72 w72))
(if (= (cdr old72) 0)
(progn ; Left Align
(if (= w72 0)
(setq ent (subst new10 old10 ent))
(progn
(setq new11 (cons 11 (list (car xpnt) (cadr (cdr old10)))))
(setq ent (subst new11 old11 ent))
);of progn
) ;of if
(setq ent (subst new72 old72 ent))
) ;of progn
(progn ; not left
(if (= w72 0)
(setq ent (subst new10 old10 ent))
(setq ent (subst new11 old11 ent))
) ;of if
(setq ent (subst new72 old72 ent))
)
)
(entmod ent)
(setq count (1+ count))
)
)