;;; ;;; This program will modify the text justification of a selection ;;; set of text entities. The only input required is the desired ;;; text justification and selection of the text to modify. There ;;; is no need to worry about selecting non-text entities because ;;; they will be automatically filtered out of the selection set. ;;; DO NOT select more than one "common note group". All of the text ;;; selected is assumed to belong to such a group and it ALL will be ;;; justified to the same reference position. ;;; ;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 7-12-94 ;;;> EDITED: 04-08-1997 ;;; (defun c:txtj ( / tjst tset tsln cntr tent edtw xofbl tj72 tj73 tj10 tj11 enty entz) (initget 1 "Align Fit Left Center Middle Right TL TC TR ML MC MR BL BC BR") (setq tjst (getkword "New Alignment? Align/Fit/Left/Center/Middle/Right/TL/TC/TR/ML/MC/MR/BL/BC/BR ") );setq (prompt "\nSelect Text: ") (setq tset (ssget '((0 . "TEXT")))) (if tset (progn (setq tsln (sslength tset)) (setq cntr 0) (cond ((eq (substr tjst 1 1) "A") (if (> tsln 1) (progn (prompt "\nSelect only one text string!") (setq tset nil) );progn (setq tj72 3 tj73 0 tj10 (upoint 1 "" "\nFirst Align point" nil nil) tj11 (upoint 1 "" "\nSecond Align point" nil nil) );setq );if ) ((eq (substr tjst 1 1) "F") (if (> tsln 1) (progn (prompt "\nSelect only one text string!") (setq tset nil) );progn (setq tj72 5 tj73 0 tj10 (upoint 1 "" "\nFirst Fit point" nil nil) tj11 (upoint 1 "" "\nSecond Fit point" nil nil) );setq );if ) ((eq (substr tjst 1 1) "L") (setq tj72 0 tj73 0 tj10 (upoint 1 "" "\nLeft justification line" nil nil) tj11 (list 0.0 0.0 0.0) );setq ) ((eq (substr tjst 1 1) "C") (setq tj72 1 tj73 0 tj10 nil tj11 (upoint 1 "" "\nCenter justification line" nil nil) );setq ) ((eq (substr tjst 1 1) "M") (setq tj72 4 tj73 0 tj10 nil tj11 (upoint 1 "" "\nMiddle justification line" nil nil) );setq ) ((eq (substr tjst 1 1) "R") (setq tj72 2 tj73 0 tj10 nil tj11 (upoint 1 "" "\nRight justification line" nil nil) );setq ) ((eq tjst "TL") (setq tj72 0 tj73 3 tj10 nil tj11 (upoint 1 "" "\nTop Left justification line" nil nil) );setq ) ((eq tjst "ML") (setq tj72 0 tj73 2 tj10 nil tj11 (upoint 1 "" "\nMiddle Left justification line" nil nil) );setq ) ((eq tjst "BL") (setq tj72 0 tj73 1 tj10 nil tj11 (upoint 1 "" "\nBottom Left justification line" nil nil) );setq ) ((eq tjst "TC") (setq tj72 1 tj73 3 tj10 nil tj11 (upoint 1 "" "\nTop Center justification line" nil nil) );setq ) ((eq tjst "MC") (setq tj72 1 tj73 2 tj10 nil tj11 (upoint 1 "" "\nMiddle Center justification line" nil nil) );setq ) ((eq tjst "BC") (setq tj72 1 tj73 1 tj10 nil tj11 (upoint 1 "" "\nBottom Center justification line" nil nil) );setq ) ((eq tjst "TR") (setq tj72 2 tj73 3 tj10 nil tj11 (upoint 1 "" "\nTop Right justification line" nil nil) );setq ) ((eq tjst "MR") (setq tj72 2 tj73 2 tj10 nil tj11 (upoint 1 "" "\nMiddle Right justification line" nil nil) );setq ) ((eq tjst "BR") (setq tj72 2 tj73 1 tj10 nil tj11 (upoint 1 "" "\nBottom Right justification line" nil nil) );setq ) );cond );progn );if (while (if (and (< cntr tsln) tset) (setq tent (entget (ssname tset cntr))) );if (progn (setq edtw (entget (cdar tent))) (if (eq (cdr (assoc 0 edtw)) "TEXT") (progn (setq ent72 (cdr (assoc 72 edtw)) ent73 (cdr (assoc 73 edtw)) ent0y (caddr(assoc 10 edtw)) ent0z (cadddr(assoc 10 edtw)) tj11x (car tj11) tj11y (cadr tj11) tj11z (caddr tj11) ent1x (cadr(assoc 11 edtw)) ent1y (caddr(assoc 11 edtw)) ent1z (cadddr(assoc 11 edtw)) );setq (setq edtw (subst (cons 72 tj72) (assoc 72 edtw) edtw ) );setq (setq edtw (subst (cons 73 tj73) (assoc 73 edtw) edtw ) );setq (cond ((eq (substr tjst 1 1) "L") (setq edtw (subst (list 11 0.0 0.0 0.0) (assoc 11 edtw) edtw ) );setq (setq tj10x (car tj10) edtw (subst (list 10 tj10x ent0y ent0z) (assoc 10 edtw) edtw ) );setq ) ((not(or(eq (substr tjst 1 1) "A")(eq (substr tjst 1 1) "F"))) (setq edtw (subst (list 11 tj11x ent0y ent0z) (assoc 11 edtw) edtw ) );setq ) ((or(eq (substr tjst 1 1) "A")(eq (substr tjst 1 1) "F")) (setq edtw (subst (list 11 tj11x tj11y tj11z) (assoc 11 edtw) edtw ) );setq (setq tj10x (car tj10) tj10y (cadr tj10) tj10z (caddr tj10) edtw (subst (list 10 tj10x tj10y tj10z) (assoc 10 edtw) edtw ) );setq ) );cond (entmod edtw) );progn );if (setq cntr (1+ cntr)) );progn );while );defun