Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

converting text to mtext

23 REPLIES 23
SOLVED
Reply
Message 1 of 24
wbrustle
62506 Views, 23 Replies

converting text to mtext

Hi,

I have a drawing that was sent to me that has several lines of "text" that were used to label contouts....Is there a way to choose each individual string of text as a group and have each one convert to a mtext without stacking them together. I obviously want them each to stay at there current location.  

23 REPLIES 23
Message 2 of 24
antoniovinci
in reply to: wbrustle

Command:  _TXT2MTXT

Message 3 of 24
wbrustle
in reply to: antoniovinci

when I tried to use that command and selected all of the strings of text, it still stacked them as one mtext. I want to keep them seperate

Message 4 of 24
AllenJessup
in reply to: wbrustle

I know there was a lisp around but I haven't been able to locate it.

 

In the mean time. Here is a roundabout way.

 

Draw a line from the insert of one text object to any point in space

Start the TXT2MTXT command and select the text you drew the line from. Run the command with only that single text object selected. The text will shift.

 

Use Grips to snap the loose end of the line you drew to the new insert of the text. That will give you the shift that occurred.

 

Use the Multiple command to start TXT2MTXT. Select each piece of text and hit enter after that selection. Then select the next piece of text. This runs the TXT2MTXT in a loop. Use ESC to quit.

 

After all have been converted. Select them all and rt-click to get Justify off the rt-clk menu. Restore the original justification and use the line you drew to move the text back to the original location.

 

Hopefully someone will jump in with a better method before you have to resort to this.

 

Allen

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 5 of 24
wbrustle
in reply to: AllenJessup

ok....thanks.... yes if you find that lisp, please post it...would be helpful

Message 6 of 24
AllenJessup
in reply to: wbrustle

You can look through this thread and see if anything posted there will work. http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Looking-for-lsp-that-converts-text-to... .

 

There's also some here http://www.cadtutor.net/forum/showthread.php?16678-Convert-text-to-mtext-in-lisp .

 

Allen

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 7 of 24
~Opie
in reply to: wbrustle

Here is a quick and dirty one.  Each selected text item will be converted individually using the txt2mtxt command.

(defun c:-txt2mtxt (/ ss cnt)
  (setq ss (ssget '((0 . "TEXT"))))
  (if ss
    (repeat (setq cnt (sslength ss))
      (command "txt2mtxt" (ssname ss (setq cnt (1- cnt))) "")
    )
  )
)

 

Message 8 of 24
wbrustle
in reply to: AllenJessup

Thank you



Wendy

Message 9 of 24
wbrustle
in reply to: ~Opie

Is that a lisp routine? I am not to sure what to do with it? Can you explain please?

Message 10 of 24
jmayo-EE
in reply to: wbrustle

TXT2MTXT will do this. When you use txt2mtxt do not select anything. Hit return and a dialog will magically appear. 🙂 If you uncheck the Create Word-Wrap MText the conversion will not later the alignment...You may also want to hit the Selection set if things aren't stacked properly.

John Mayo

EESignature

Message 11 of 24
AllenJessup
in reply to: jmayo-EE

John,

 

That's strange. I had thought to try that. But Txt2Mtxt still changes the justification from lower left to top left even with  Create Word-Wrap unchecked.

 

Allen

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 12 of 24
troma
in reply to: AllenJessup

Here's the lisp that I use.  Not sure who wrote it or where I found it anymore.

 

 


Mark Green

Working on Civil 3D in Canada

Message 13 of 24
~Opie
in reply to: wbrustle

Yes, that is a lisp routine. You can either copy and paste the above code to the command prompt or save it to a file. If saved to a file with a .lsp file extension. You would need to load the file into your current session. There are several ways to do that, however, the quickest way is to drag and drop it into your drawing. You would need to do that every time.

Now that it is loaded into your drawing, type -txt2mtxt and select all of the text objects. It should cycle through that selection set one at a time and execute the txt2mtxt command for each item.
Message 14 of 24
jmayo-EE
in reply to: AllenJessup

Sry Allen I was talking about the items stacking properly. If the justification on the object is an issue then yu'll need custom routines as previously noted.

John Mayo

EESignature

Message 15 of 24
antoniovinci
in reply to: troma

@ Opie & Jmayo

 

Gentlemen, the TXT2MTXT express tool does not do what the OP's looking for.

 

@ Troma

 

Seems like yours gets the goal, but are you really sure the Dtext won't move, staying in the same original place..?

Message 16 of 24
~Opie
in reply to: antoniovinci

@antoniovinci

 

Are you referring to the AutoLISP routine I posted?  I beg to differ, but I'm not the OP.

Message 17 of 24
troma
in reply to: antoniovinci

@antoniovinci
I don't know if it moves a little, but it doesn't move much. I've used it for contour labels myself.

Mark Green

Working on Civil 3D in Canada

Message 18 of 24
AllenJessup
in reply to: troma


@troma wrote:

Here's the lisp that I use.  Not sure who wrote it or where I found it anymore.

 

 


That converts the DText to Mtext without stacking. However it changes the justification from Left to Bottom Left.

 

Allen

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 19 of 24
antoniovinci
in reply to: ~Opie


~Opie wrote:

I beg to differ


My apologies, sir, I've only read the code without testing it.

That's brilliant, your lisp is definitely the ultimate solution of this topic: you deserve for a (rare) kudo by me.

Message 20 of 24
AllenJessup
in reply to: wbrustle

You could use the Txt2MText from http://dotsoft.com/freestuff.htm

 

It seems to offer multiple options in conversion. I used to use a previous version of this before the similar command was offered in Express Tools.

 

Allen

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report