Vigilante Posted December 6, 2006 Share Posted December 6, 2006 Hi all, I've searched google and this forum and not found much. Some help would be appreciated. Basically, we get documents from other people and we convert those to our formats to do our work. We use a font called Simplex, but sometimes their document is filled with, like, Comic Sans or something stupid. The match properties command doesn't seem to change font, just size and alignment. When I use the font properties dialog box, I can set simplex as the font, but when I make new text, it still matches their comic sans. It's kinda weird. So two questions: How do I change the default font for the document so that all new text is the way I want it? And is there a LISP routine which will find all text and change the font property and stuff the way I want it? For multi-line and single line text. Also note, I've tried selecting all the text and editing properties, but font is not one of the properties I can change. To change font, I have to edit every piece of text one by one. And then ONLY multiline text has the properties to change font. So frankly I don't even know how to change the font of a single line text object. Any help for me? Thanks a bunch. Quote Link to comment Share on other sites More sharing options...
profcad Posted December 6, 2006 Share Posted December 6, 2006 So frankly I don't even know how to change the font of a single line text object. Any help for me? Thanks a bunch. Use the STYLE command and change the font of the text style that the single text object is using. Once you change the style, all single line text objects using that style will update globally. Quote Link to comment Share on other sites More sharing options...
Vigilante Posted December 6, 2006 Author Share Posted December 6, 2006 Hey cool, that's what I needed. The only thing is, when in the style dialog, it has like a drop down for "style name", and the document has like 7 or 8 or more styles. So I have to click each style, change the font, next, next etc... So then, it would be cool to place all text objects in one style name, delete the rest, and then I can change just that one style. So then, is there a lisp to place all text in one style and remove the others? Just asking. Thanks again. Quote Link to comment Share on other sites More sharing options...
CarlB Posted December 6, 2006 Share Posted December 6, 2006 You could select all text (using QSELECT or FILTER or SSX), then open 'properties' dialogue box then select style name to change all to. Quote Link to comment Share on other sites More sharing options...
Vigilante Posted December 6, 2006 Author Share Posted December 6, 2006 Hmm, I'll give it a try, thanks. Quote Link to comment Share on other sites More sharing options...
Wozza Posted December 11, 2006 Share Posted December 11, 2006 (edited) Vigilante, I've been meaning to write something that will do this for some time and your question has prompted me to do it. It hasn't been tested a lot, but seems to work (and I wasn't sure how to select all text and all mtext in the one hit, so I cheated and ran the routine twice...). It changes all text to isocp.shx, but you could change that to whatever font you need. (defun C:CHANGESTYLE (/ entities len count ent ent_data ent_name new_style_name) (command "STYLE" "iso" "isocp.shx" "" "" "" "" "") (setq entities (ssget "X" '((0 . "TEXT"))) len (sslength entities) count 0 );setq (while (< count len) (setq ent (ssname entities count) ent_data (entget ent) ent_name (cdr (assoc 7 ent_data)) );setq (setq new_style_name (cons 7 "iso")) (setq ent_data (subst new_style_name (assoc 7 ent_data) ent_data)) (entmod ent_data) (setq count (+ count 1)) );while ;;;runs same routine again, picking up Mtext this time. (setq entities (ssget "X" '((0 . "MTEXT"))) len (sslength entities) count 0 );setq (while (< count len) (setq ent (ssname entities count) ent_data (entget ent) ent_name (cdr (assoc 7 ent_data)) );setq (setq new_style_name (cons 7 "iso")) (setq ent_data (subst new_style_name (assoc 7 ent_data) ent_data)) (entmod ent_data) (setq count (+ count 1)) );while (princ) );defun Edited January 23, 2012 by SLW210 Add TAGS! Quote Link to comment Share on other sites More sharing options...
CarlB Posted December 11, 2006 Share Posted December 11, 2006 (edited) Wozza, Some some selection filter tips to help keep your routines shorter... The selection filter allows using multiple data by combining with commas, and use of wildcards. So you could use either of the following to select text & mtext: (setq entities (ssget "X" '((0 . "TEXT,MTEXT"))) -or- (setq entities (ssget "X" '((0 . "*TEXT"))) Edited January 23, 2012 by SLW210 Quote Link to comment Share on other sites More sharing options...
Wozza Posted December 12, 2006 Share Posted December 12, 2006 Carl, Thanks for that. With all the places available to look for info on this I couldn't find anything that explained 'select all this type of entity AND this type of entity'. Incidently, it seems that some Mtext will not change the way it looks (using the above routine) until it's been exploded. Exploding the text doesn't cause any problems for us, so I included this line just after the last (entmod ent_data) (command "explode" ent) Seems to work OK. Quote Link to comment Share on other sites More sharing options...
CarlB Posted December 12, 2006 Share Posted December 12, 2006 Wozza, Probably the reason for the need to explode some mtext is that it has font set other than by text style, such as when user changes text within the mtext editor. And for a good reference on "ssget" filters, see http://intervision.hjem.wanadoo.dk/ssget2.htm Quote Link to comment Share on other sites More sharing options...
amiralwaled Posted January 23, 2012 Share Posted January 23, 2012 Use the STYLE command and change the font of the text style that the single text object is using. Once you change the style, all single line text objects using that style will update globally. Thanks for the helpful information. Quote Link to comment Share on other sites More sharing options...
Tiedyemind Posted January 30, 2012 Share Posted January 30, 2012 Vigilante, I've been meaning to write something that will do this for some time and your question has prompted me to do it. It hasn't been tested a lot, but seems to work (and I wasn't sure how to select all text and all mtext in the one hit, so I cheated and ran the routine twice...). It changes all text to isocp.shx, but you could change that to whatever font you need. (defun C:CHANGESTYLE (/ entities len count ent ent_data ent_name new_style_name) (command "STYLE" "iso" "isocp.shx" "" "" "" "" "") (setq entities (ssget "X" '((0 . "TEXT"))) len (sslength entities) count 0 );setq (while (< count len) (setq ent (ssname entities count) ent_data (entget ent) ent_name (cdr (assoc 7 ent_data)) );setq (setq new_style_name (cons 7 "iso")) (setq ent_data (subst new_style_name (assoc 7 ent_data) ent_data)) (entmod ent_data) (setq count (+ count 1)) );while ;;;runs same routine again, picking up Mtext this time. (setq entities (ssget "X" '((0 . "MTEXT"))) len (sslength entities) count 0 );setq (while (< count len) (setq ent (ssname entities count) ent_data (entget ent) ent_name (cdr (assoc 7 ent_data)) );setq (setq new_style_name (cons 7 "iso")) (setq ent_data (subst new_style_name (assoc 7 ent_data) ent_data)) (entmod ent_data) (setq count (+ count 1)) );while (princ) );defun You said that this will change all text to a certain font. Will it change the text within to a certain Text Style. I came across this thread and I'm trying to find a lisp that will change all text in drawings to a single style, namely the style Standard. An I'm also looking to globally change all the dims to a certain dim style as well, namely the style Standard. I'm guessing here but will a script work as well? I'm also working in AutoCAD Architecture 2012. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.