AutoCAD 2007/2008/2009

Reply
Active Member
lrussell88
Posts: 7
Registered: ‎06-22-2008
Message 1 of 15 (4,038 Views)

Converting Text to MText

4038 Views, 14 Replies
07-09-2008 05:00 PM
Hi,

When converting text to mtext it seems to me that you can only really do it one text entity at a time. As in if you select multiple pieces of text and 'Convert to MText' it will join all those pieces together into one text block. This is using the txt2mtxt written command or using Express > Text > Convert to Mtext.

Is there a way that you can select multiple pieces of text, convert them to MText and keep them all in their original position and orientation?
Distinguished Mentor
lpseifert
Posts: 889
Registered: ‎08-08-2006
Message 2 of 15 (4,038 Views)

Re: Converting Text to MText

07-10-2008 04:21 AM in reply to: lrussell88
;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
) ;setq
(repeat SetLen ;repeat setlen 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)
)
~~~Civil 3D 2008~~~
Active Member
lrussell88
Posts: 7
Registered: ‎06-22-2008
Message 3 of 15 (4,037 Views)

Re: Converting Text to MText

07-10-2008 04:52 PM in reply to: lrussell88
Thanks for that, where am I meant to paste that into?
Distinguished Contributor
toan76
Posts: 604
Registered: ‎11-13-2006
Message 4 of 15 (4,037 Views)

Re: Converting Text to MText

07-10-2008 05:05 PM in reply to: lrussell88
Create a new .lsp file, say T2M.lsp, and add it to your start up suite contents.
Thanks for the code. It's useful.
Active Member
lrussell88
Posts: 7
Registered: ‎06-22-2008
Message 5 of 15 (4,037 Views)

Re: Converting Text to MText

07-10-2008 05:32 PM in reply to: lrussell88
Great, thanks for that. Works a treat
Valued Mentor
KLYPHY
Posts: 359
Registered: ‎09-25-2008
Message 6 of 15 (3,733 Views)

Re: Converting Text to MText

02-02-2012 07:30 AM in reply to: lpseifert

Thank You, Thank You,

I wish I had seen your Reply six years ago.

You gave me the lisp I've been needing.

 

How did I find your lisp?

In "caddude" discussion "Convert multilple text items to mtext WITHOUT combing into 1 mtext",

"Johneng" linked to your reply in "L Russell"s "Converting Text to Mtext". 

 

I'm glad AutoDESK has the AutoCAD Discussion Groups for us to share with each other, eve years later.

 

Again, thanks.

Read Ya Later -KLYPH

*Expert Elite*
troma
Posts: 2,519
Registered: ‎05-21-2008
Message 7 of 15 (3,701 Views)

Re: Converting Text to MText

02-07-2012 05:56 AM in reply to: lpseifert

Hi Ipseifert

I'm interested in your lisp code, thanks for posting it.

 

I've never used lisp code, so I'm just wondering how it will work.

Will this map my command TXT2MTXT to always make separate MTEXT objects?  Ideally for me I would like to have an option every time I run the command; sometimes I want one large piece of MTEXT and sometimes I want them to stay on their own.  Is that possible?  Could I set up my keyboard shortcuts (pgp file) to have one shortcut to run the command with your lisp and one to run it without?  I really don't know what is possible in this area.

 

Also, there is the obvious question of whether it will work on the newer releases since you posted it nearly four years ago.


Credit where credit is due! Give kudos or accept as solution whenever you can.

Valued Contributor
caddude
Posts: 62
Registered: ‎02-13-2003
Message 8 of 15 (3,689 Views)

Re: Converting Text to MText

02-07-2012 10:03 AM in reply to: lpseifert

Very awesome!  Works exactly how I want it to.  Now if we could only have Autodesk add this in as an option for converting mtext that way all users could enjoy it without trying to play with lisp.

 

Thank you!

Active Contributor
featho
Posts: 29
Registered: ‎11-05-2006
Message 9 of 15 (2,859 Views)

Re: Converting Text to MText

11-28-2012 04:48 PM in reply to: lpseifert

Hello

 

This sounds like and absolutely awesome lisp file.

 

I have copied the code into a .lsp file and loaded it through appload.

 

However when I go to use it it won't work for me.

 

Any idea why?

 

Kind regards

 

Featho

 

Active Contributor
featho
Posts: 29
Registered: ‎11-05-2006
Message 10 of 15 (2,856 Views)

Re: Converting Text to MText

11-28-2012 08:22 PM in reply to: featho

I have fixed the problem team.

 

I had to match the actual name of the lisp file with the ref in the lisp code and then it worked fine.

 

I called it dt2mt rather than t2m.

 

Cheers

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community




Connect with AutoCAD

Twitter

Facebook

Blogs

Pinterest

Youtube