Message 1 of 9
Routine for modifying multiple Text Styles and their settings in a .dwg

Not applicable
12-30-2022
02:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to write a routine that modifies all the Text Styles in a .dwg file by changing the SHX Font to "romans.shx", the Big Font to "special.shx". the Height to "0", and the Width Factor to "0.75".
The string I've written appears to work but the Text Style settings revert to their previous state after saving, closing, and reopening the .dwg.
What am I doing wrong?
Thanks.
(defun c:styles2one (/ styl)
(while (setq styl (tblnext "STYLE" (not styl)))
(setq styl (entget (tblobjname "STYLE" (cdr (assoc 2 styl)))))
(entmod (subst (cons 3 "RomanS") (assoc 3 styl) styl))
(entmod (subst (cons 4 "special") (assoc 4 styl) styl))
(entmod (subst (cons 40 0) (assoc 40 styl) styl))
(entmod (subst (cons 41 0.75) (assoc 41 styl) styl))
(command ".regen")
(princ))
)