I am running into a problem with this lisp. What I am trying to is to have 2 Text styles changed from simplex.shx to swiss721 BT. If you look at the lisp @ defun c:fx1. This is where I would like to have it change. Can some please point me in the right direction?
Thank you for all your help.
Date Modified: 04/22/05
By Whom: Bcrouse
(defun C:fx ( / stylist txtstyle ss indx ent ent_alst str)
(setvar "cmdecho" 0)
(command "_.undo" "be")
(setq stylist '("NOTES" "DWGTITLES" "DWGTITLE" "HANDDWGTITLE" "HANDWGTITLES" "HANDWGTITLE" "RMNAMES"))
(while (/= stylist nil)
(setq txtstyle (car stylist))
(if (= (tblsearch "STYLE" txtstyle) nil)
(command "-style" txtstyle "simplex.shx" 0 0.7 0 "No" "No" "No")
(fixtxtstyle txtstyle)
)
(setq stylist (cdr stylist))
)
(setq ss (ssget "X" '((0 . "TEXT,MTEXT")
(7 . "NOTES,DWGTITLES,DWGTITLE,HANDWGTITLE,HANDDWGTITLEs,HANDWGTITLEs,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 0.7) (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" "NOTES")
(setvar "cmdecho" 1)
(princ)
)
(defun fixtxtstyle (txtsty / txtsty)
(setq txtsty (entget (tblobjname "STYLE" txtsty)))
(setq txtsty (subst (cons 41 0.7) (assoc 41 txtsty) txtsty))
(setq txtsty (subst (cons 3 "simplex.shx") (assoc 3 txtsty) txtsty))
(entmod txtsty)
)
(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))
(if (= (tblsearch "STYLE" txtstyle) nil)
(command "-style" txtstyle "Swis721 BT.shx" 0 0.7 0 "No" "No" "No")
(fixtxtstyle txtstyle)
)
(setq stylist (cdr stylist))
)
(setq ss (ssget "X" '((0 . "TEXT,MTEXT")
(7 . "DWGTITLES,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 0.7) (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 "cmdecho" 1)
(princ)
)
(defun fixtxtstyle (txtsty / txtsty)
(setq txtsty (entget (tblobjname "STYLE" txtsty)))
(setq txtsty (subst (cons 41 0.7) (assoc 41 txtsty) txtsty))
(setq txtsty (subst (cons 3 "Swis721 BT.shx") (assoc 3 txtsty) txtsty))
(entmod txtsty)
)