;;;
;;; MATCH TEXTSTYLE
;;; FIRST PICK GETS TEXTSTYLE FROM FIRST TEXT OBJECT.
;;; SECOND PICK SETS TEXTSTYLE OF SECOND TEXT OBJECT.
;;; MULTIPLE OBJECTS CAN BE SELECTED ON SECOND PICK.
;;;
;;;
;;; Tharwat - 14.10.16 ;;
;;;
(defun c:2ts ( / ts ss sn)
;;; ADDED CODE BELOW
(setq ss2 (ssget "_:S" (list '(0 . "TEXT,MTEXT"))))
(setq sn2 (ssname ss2 0))
(setq tsentget (cdr (assoc 7 (entget sn2))))
(terpri)
(princ (strcat "TextStyle will be updated to " tsentget))
(terpri)
;;; ADDED CODE ABOVE
;;;
;;; MODIFIED
;; Tharwat - 14.10.16 ;;
;;;(setq ts "title") COMMENTED THIS LINE OUT
(setq ts tsentget)
(if (tblsearch "STYLE" ts)
(if (and (princ (strcat "\nSelect texts to move to Text Style <" ts ">:"))
(setq ss (ssget "_:L" (list '(0 . "TEXT,MTEXT") '(-4 . "<NOT") (cons 7 ts)
'(-4 . "NOT>"))))
)
(while (setq sn (ssname ss 0))
(entmod (append (entget sn) (list (cons 7 ts))))
(ssdel sn ss)
)
)
(princ (strcat "\nText Style <" ts "> is not found!"))
)
(princ)
)
;;;
;;; ERROR TRAP
;;;
(defun *error* (errormsg)
(VL-BT)
(princ "error: ")
(alert errormsg)
(princ)
(gc)
)
;;;