I need to add the create Text Style before I do a text style merge. I would like it to add this to the lisp that is associated with this thread. How would I go about doing this. I know that I need to ensure that the font style is found. But I don't know how to do that. Can someone please point me in the right direct?
Date Modified: 04/27/05
By Whom: Bcrouse
(defun C:fx1 ( / stylist txtstyle ss indx ent ent_alst str)
(setvar "cmdecho" 0)
(command "_.undo" "be")
(setq stylist '("DWGTITLES" "RMNAMES"))
(while (/= stylist nil)
(setq txtstyle (car stylist))
(setq txtstyle1 (car stylist))
(if (= (tblsearch "STYLE" txtstyle) nil)
(command "-style" txtstyle "Swis721 BT.shx" 0 1.20 0 "No" "No" "No")
(command "-style" txtstyle1 "Swis721 BT.shx" 0 .7 0 "No" "No" "No")
(fixtxtstyle1 txtstyle)
)
(setq stylist (cdr stylist))
)
(setq ss (ssget "X" '((0 . "TEXT,MTEXT")
(7 . "DWGTITLES"))))
(7 . "RMNAMES"))))
(setq indx 0)
(if (/= ss nil)
(while (<= indx (- (sslength ss) 1))
(setq ent (ssname ss indx))
(setq ent_alst (entget ent))
(cond
((= (cdr (assoc 0 ent_alst)) "TEXT")
(setq ent_alst (subst (cons 41 1.20) (assoc 41 ent_alst) ent_alst))
)
((= (cdr (assoc 0 ent_alst)) "MTEXT")
(setq str (cdr (assoc 1 ent_alst)))
(if (/= (vl-string-position (ascii ";") str) nil)
(progn
(setq str (strcat "{" (substr str (+ (vl-string-position (ascii ";") str) 2))))
(setq ent_alst (subst (cons 1 str) (assoc 1 ent_alst) ent_alst))
)
)
)
)
(entmod ent_alst)
(entupd ent)
(setq indx (1+ indx))
)
)
(command "_.regen")
(command "_.undo" "end")
(setvar "textstyle" "DWGTITLES")
(setvar "textstyle1" "RMNAMES")
(setvar "cmdecho" 1)
(princ)
)
(defun fixtxtstyle1 (txtsty / txtsty)
(setq txtsty (entget (tblobjname "STYLE" txtsty)))
(setq txtsty (subst (cons 41 1.20) (assoc 41 txtsty) txtsty))
(setq txtsty (subst (cons 41 .7) (assoc 41 txtsty) txtsty))
(setq txtsty (subst (cons 3 "swis721 BT.shx") (assoc 3 txtsty) txtsty))
(entmod txtsty)
)
Thank you for all of your help.
Brad