Lee Mac Posted December 16, 2009 Share Posted December 16, 2009 (edited) Had posted this over at theSwamp a while back, wasn't sure that I'd shared it with you guys, so here you are Text-2-MText Upgraded Version 2.0 Program will allow the user to amalgamate several separate DTEXT & MTEXT entities into a single MTEXT entity, with all formatting kept in tact. Text will take on the layer of the first text entity chosen (as in the txt2mtxt.lsp), but will keep its colour if not set to BYLAYER. There are two modes: "Same Line" "New Line", which can be switched by pressing space between selections. Shift-Clicking on Text will keep the original Text in place, and pressing "u" between selections will undo the previous selections. Example: Your thoughts are welcome Lee --=={ Code Updated to Version 2.0 }==-- Code available here. Edited July 24, 2012 by Lee Mac Quote Link to comment Share on other sites More sharing options...
Krztoff Posted December 16, 2009 Share Posted December 16, 2009 Woah... this is so downright awesome. Thanks for sharing! There have been plenty of times in the past when such a tool would have come in really handy. Quote Link to comment Share on other sites More sharing options...
JeepMaster Posted December 16, 2009 Share Posted December 16, 2009 That's a great lisp Lee. The only thing I wish is that if you missed clicking on the DTEXT, it will stay in command instead of exiting. Or else you'll need to redo the command. Quote Link to comment Share on other sites More sharing options...
Pablo Ferral Posted December 16, 2009 Share Posted December 16, 2009 Yeah, I'm thinking 'How do you create those neat little GIF animations'! - Nice code too, of course! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 16, 2009 Author Share Posted December 16, 2009 Thanks Guys The problem with avoiding the misclick is how to know when the user wants to position the final result, or select another text item... As for the GIFs... Camtasia! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 30, 2010 Author Share Posted March 30, 2010 Haven't looked at this code for ages, but finally changed the code to fix the bug if the user mis-clicks some text/Mtext. The user can now hit Enter or Right-Click to Place the converted MText. Enjoy, Lee Quote Link to comment Share on other sites More sharing options...
sachindkini Posted March 31, 2010 Share Posted March 31, 2010 Dear Sir, Very Good lsp Thx for Sharing Which Software use to screen recorder & gif converter Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 31, 2010 Author Share Posted March 31, 2010 Thanks Software for the GIF is noted a couple of posts above Quote Link to comment Share on other sites More sharing options...
DVDM Posted April 14, 2010 Share Posted April 14, 2010 Hi Lee, This is really nice in how it allows you to pick text visually, but I must say that for 95% of the situations I come across, the standard txt2mtxt works for me. The one thing that would really help me though, is the ability to keep certain formatting of the text once converted to mtext. Example: I have a single line text that's underlined. After converting to mtext, it shows up as '%%UThis is text.' I have to then go in and remove the %%U, and format the text with an underline. If your routine could take care of that and keep the underline it would be awesome Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 14, 2010 Author Share Posted April 14, 2010 Hi DVDM, Thats a great suggestion, and one that I had not accounted for. I realise that there exists the Express Tools function, but this program was really more of a proof of concept than anything else, and to provide a little more control over the conversion (with the two modes). I shall see what I can do when I get some time! Thanks, Lee Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 14, 2010 Share Posted April 14, 2010 Hi DVDM, Thats a great suggestion, and one that I had not accounted for. I realise that there exists the Express Tools function, but this program was really more of a proof of concept than anything else, and to provide a little more control over the conversion (with the two modes). I shall see what I can do when I get some time! Thanks, Lee If memory serves, I think these are the popular ones... %%u %%d %%c %%p Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 14, 2010 Author Share Posted April 14, 2010 Thanks Alan, I shall see what I can do when I get some spare time Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 14, 2010 Share Posted April 14, 2010 No problem. Was trolling and thought I'd pop in and add that bit of information. Aside from %%c, I haven't used those codes in a few years (don't use a lot of DText), so I'm sure someone else could enlighten you to more of them. Quote Link to comment Share on other sites More sharing options...
DVDM Posted April 15, 2010 Share Posted April 15, 2010 I still use the %%c, d & p strings regularly, but never %%u. There's not a problem with these though, since they get picked up by Mtext without a problem and show their respective symbols after converting. I have another suggestion. The txt2mtxt routine converts to Mtext with a Defined Width and Height (with grips for resizing). I prefer this behaviour over your end result, which has no defined width and height, just a single grip for position, and my text line will keep growing to the right until I hit return. Which is not what I want since I often use indented numbering. I do like the fact how I can combine 2 separate Mtext's using your routine, that's something txt2mtxt can't do at all. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 15, 2010 Author Share Posted April 15, 2010 Oh yes, I create MText with a width of zero - this seemed like the easiest way at the time, but I can see how this needs to be changed Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 15, 2010 Author Share Posted April 15, 2010 I have updated the first post to Version 1.6, hopefully this resolves the MText width issue, and the Underlining problem. Quote Link to comment Share on other sites More sharing options...
DVDM Posted April 16, 2010 Share Posted April 16, 2010 Hi Lee, I've tried your update, and for some reason the %%u issue remains. The text width works perfect though. I thought the issue might be because in my text I have %%u, not %%U, but I tested and the result is the same either way. I've attached a drawing with the original text I'm trying to convert so you can see what's happening, and next to it a txt2mtxt and t2m conversion. The Spacebar toggle is a very nice option as well, and will definately come in handy for me. I've noticed that if you add two lines into one it automatically inserts a 'space' between the two strings, which ofcourse makes sense, and works perfect if the single line text is properly formatted. Some of the text I've tried to merge though seems to have extra blank spaces before and after the text due to sloppy formatting by some lazy draughtsman who couldn't be bothered to move the text, instead just shuffling the text along by throwing in a few extra spaces. Merging these then creates a wider gap because all these blank spaces are maintained. It might be worthwhile to automatically remove these extra blank spaces as you merge the two lines? I also tested the 'Shift' + select functionality, to keep the original text, but it seems that it can only work on text selected after the first selection, i.e. the first string you select cannot maintain its original by pressing Shift. Anyway, I really appreciate the time you spend making, fixing and improving this and other Modification Suites you've made available. Mtext example.dwg Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 16, 2010 Author Share Posted April 16, 2010 Hi DVDM, Thanks for your continued feedback, it is appreciated indeed. Please try the latest version, hopefully the underline bug has now been fixed. I have also added the ability to shift-click the first text item selected, and have resolved a few issues regarding the Undo functionality. Extra spaces will also be trimmed when in 'Same-Line' mode to allow for those cases you mentioned. Thanks, Lee Quote Link to comment Share on other sites More sharing options...
ayman Posted April 16, 2010 Share Posted April 16, 2010 good work lee thank's for sharing Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 16, 2010 Author Share Posted April 16, 2010 You're welcome 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.