muck Posted September 24, 2007 Share Posted September 24, 2007 Subject Convert text to mtext in lisp? What lisp command to convert strings to mtext? I am looking for (or maybe making) a lisp routine that would change text to mtext by allowing the user to select a group of strings in a drawing. The routine would change the first text string to mtext then allow the user edit that string. Then the routine would go down to the second string to make a mtext conversion then let the user edit that string. Then the rountine would to the the third string and so on. Hopefully the routine would move form left to right then down. Simular movement as reading a book. Has anyone done this?? First things first, Does anyone know a lisp command to convert text to mtext? thank you, Quote Link to comment Share on other sites More sharing options...
tzframpton Posted September 24, 2007 Share Posted September 24, 2007 what version of CAD are you running? If it's the full version, then you probably already have this feature via Express Tools. type TXT2MTXT at the command line and follow the prompt. Quote Link to comment Share on other sites More sharing options...
muck Posted September 25, 2007 Author Share Posted September 25, 2007 AutoCAD Version 2007. I noticed when a person uses a pull down (ie txt2mtxt) menu to select a group of texts strings the command will put all the strings into one mtext box. Usually the top mtext box. I really don't want that. If I select 10 text strings to convert to mtext I would like to get 10 mtext boxes in there orginal postions by window picking a group of text strings. Hopefully the mtext would be in the same positions as the previous text strings. thank you, Quote Link to comment Share on other sites More sharing options...
Raggi_Thor Posted September 25, 2007 Share Posted September 25, 2007 That can be done in lisp, but most people wanted to group severeal dtexts into one mtext. What bout this: run the command txt2mtxt, select one text, then press enter to repeat and select the next and so on? Quote Link to comment Share on other sites More sharing options...
lpseifert Posted September 25, 2007 Share Posted September 25, 2007 If I select 10 text strings to convert to mtext I would like to get 10 mtext boxes in there orginal postions by window picking a group of text strings. Try this... ;changes text to individual mtext by Carl B. (princ "\nType T2M to start") (defun c:t2m () (setq Tset (ssget '((0 . "*TEXT")))) ;filter text in selection set (setq Setlen (sslength Tset) ;setq number of entties in selection set, setq count(er) to 0 Count 0 ) (repeat SetLen ;repeat setq times (setq Ename (ssname Tset Count)) ;setq ename to be the "0..." entity in selection set Tset (command "_txt2mtxt" Ename "") (setq Count (+ 1 Count)) ; add 1 to Count(er) ) ; Repeat (princ) ) Quote Link to comment Share on other sites More sharing options...
muck Posted September 25, 2007 Author Share Posted September 25, 2007 I will try the above code and see what it does. Here is one thing I have found. (command "txt2mtxt" "") ;Opens Mtext Conversion options dialog. If I turn off wordwrap ;feature in the dialog box my window conversions will keep the text in ;place but I don't know how to turn off that the wordwrap ;feature using lisp. Interesting Information. Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted September 25, 2007 Share Posted September 25, 2007 I am looking for (or maybe making) a lisp routine that would change text to mtext by allowing the user to select a group of strings in a drawing. ToolPac includes a routine to convert multiple TEXT entities to MTEXT, without combining them. Quote Link to comment Share on other sites More sharing options...
ofh19664 Posted September 26, 2007 Share Posted September 26, 2007 That can be done in lisp, but most people wanted to group severeal dtexts into one mtext. What bout this: run the command txt2mtxt, select one text, then press enter to repeat and select the next and so on? I read this and I would like to know if there are some lsp routine to change the high of mtext at same time, por example, if I have 10 mtext box, but with differents highs, select all of them and give them the same high, and keeping the same start point. Thank for the help!! Oskr Quote Link to comment Share on other sites More sharing options...
Raggi_Thor Posted September 26, 2007 Share Posted September 26, 2007 Yes, it's possible but the problem with Mtext is that you can have all kinds of format overrides inside the text. If the Mtexts are all with default formatting, you can use the Properties window to change the hight. Quote Link to comment Share on other sites More sharing options...
muck Posted October 1, 2007 Author Share Posted October 1, 2007 Biggest problem I have is matching mtext widths with orginal text withs after converting text to mtext. thank you, Quote Link to comment Share on other sites More sharing options...
CAB Posted October 2, 2007 Share Posted October 2, 2007 This didn't help you? http://forums.augi.com/showthread.php?t=68532 I set the width to zero. Why do you need a width? Quote Link to comment Share on other sites More sharing options...
ofh19664 Posted October 8, 2007 Share Posted October 8, 2007 This didn't help you?http://forums.augi.com/showthread.php?t=68532 I set the width to zero. Why do you need a width? OK Cab, I will try with your info. I don't know what do you mean with "need a width", I prefer to use with=0. So I will trying with the lsp you sent me! Thanks Oskr Quote Link to comment Share on other sites More sharing options...
SEGUL Posted March 31, 2009 Share Posted March 31, 2009 would there be any lisp code for changing mtxt back to Dtxt? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 31, 2009 Share Posted March 31, 2009 would there be any lisp code for changing mtxt back to Dtxt? Just explode it Quote Link to comment Share on other sites More sharing options...
SEGUL Posted March 31, 2009 Share Posted March 31, 2009 Thanks Lee Mac......i am currently working with a drawing which has lots of layers overlaying each other and if i was to explode the text i will have to isolate the text and then explode.....its only when i turn the layers back on that i have the issue of re-setting the layers back to how they should be.....as in which layer is to be set behind the other.....it adds to my other problems i have... Any addvice or assistance on the two issues will be kindy acknowledged. Thanks Just explode it Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 31, 2009 Share Posted March 31, 2009 Ok, firstly, for ordering layers - perhaps this? (defun c:orderlay (/ laylist ss) (setq laylist '("LAYER1" ; <---<< List Layers Here. "LAYER2" "LAYER3" )) (foreach lay laylist (if (and (tblsearch "LAYER" lay) (setq ss (ssget "X" (list (cons 8 lay))))) (command "_draworder" ss "" "_F"))) (princ)) Will send each layer in the list to the front in turn. - hence ordering the layers Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 31, 2009 Share Posted March 31, 2009 As for exploding each item of multi-line text, try this: (defun c:texp (/ ss) (if (setq ss (ssget "X" (list (cons 0 "MTEXT") (if (getvar "CTAB")(cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE"))))))) (progn (foreach ent (mapcar 'cadr (ssnamex ss)) (command "_explode" ent))) (princ "\n<!> No Text Found <!>")) (princ)) Quote Link to comment Share on other sites More sharing options...
SEGUL Posted April 1, 2009 Share Posted April 1, 2009 Hi Lee Mac Thank you so much for your kind help....the lisp codes work great and saves me a lot of time....... Cheers Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 1, 2009 Share Posted April 1, 2009 Hi Lee Mac Thank you so much for your kind help....the lisp codes work great and saves me a lot of time....... Cheers Excellent - I'm happy they perform as required Anything else, just ask Quote Link to comment Share on other sites More sharing options...
DonovanPorter Posted July 27, 2010 Share Posted July 27, 2010 what version of CAD are you running? If it's the full version, then you probably already have this feature via Express Tools. type TXT2MTXT at the command line and follow the prompt. works like a charm thanks 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.