Jump to content

Text 2 MText Upgraded


Lee Mac

Recommended Posts

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

 

t2m.gif

 

 

 

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:

 

t2m3.gif

 

 

 

 

Your thoughts are welcome smiley.gif

 

 

Lee

 

--=={ Code Updated to Version 2.0 }==--

 

Code available here.

Edited by Lee Mac
Link to comment
Share on other sites

  • Replies 90
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    40

  • alanjt

    10

  • asos2000

    9

  • DVDM

    4

Top Posters In This Topic

Posted Images

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.:glare:

Link to comment
Share on other sites

Thanks Guys :D

 

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! :)

Link to comment
Share on other sites

  • 3 months later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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 :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...