Notifications
Clear all

Carlson Text to Mtext

9 Posts
8 Users
0 Reactions
2 Views
(@snoop)
Posts: 1468
Registered
Topic starter
 

How do I convert a couple of single lines of text into a mtext block?

 
Posted : June 21, 2012 10:41 am
(@pin-cushion)
Posts: 476
Registered
 

You need to load the LISP.

I will send you and email in about a half hour detailing how to get this done.

 
Posted : June 21, 2012 10:47 am
(@ben-purvis)
Posts: 188
Registered
 

I just create a new mtext window and copy and paste.

Maybe there's a few less clicks way to do it?

 
Posted : June 21, 2012 10:49 am
(@foggyidea)
Posts: 3467
Registered
 

Carlson Text to Mtext>Ben

How does that work, Ben?

do you export and then import text?

 
Posted : June 21, 2012 10:53 am
(@sergeant-schultz)
Posts: 932
Registered
 

Lisp file

;;;----------------------------------------------------------------------------
;;;
;;; TXT2MTXT.LSP Version 1.0 9/30/96
;;;
;;;----------------------------------------------------------------------------
;;; DESCRIPTION
;;; Converts single line text to paragraph (mtext) text.
;;; Selected text is converted to paragraph text. The order that the text strings
;;; appear in the text paragraph is the same as the order that they are selected.
;;; The text style and layer of the paragraph text is the same as the FIRST text
;;; string selected.
;;;
;;; By Jay Garnett
;;; E-Mail spotter@lycosmail.com
;;; http://members.tripod.com/spotter10
;;;----------------------------------------------------------------------------

;;; Verifies that OBJ is single line text.
(defun CHK_TXT( OBJ )
(if (/=(cdr(assoc 0(entget OBJ)))"TEXT")
(progn(prompt"Object Selected was not TEXT!")(setq OBJ nil))
OBJ
)
)

;;; Main routine
(defun C:TXT2MTXT( / MT_LAY MT_STY OLD_LAY PARA TXT_OBJ U_CE WID)
(setq U_CE(getvar "cmdecho"))
(setvar "cmdecho" 0)
(while (not TXT_OBJ)
(setq TXT_OBJ(car(entsel "nSelect first TEXT string: ")))
(if TXT_OBJ(setq TXT_OBJ(Chk_Txt TXT_OBJ)))
)
(setq MT_STY(cdr(assoc 7(entget TXT_OBJ)))
MT_LAY(cdr(assoc 8(entget TXT_OBJ)))
MT_IPT(cdr(assoc 10(entget TXT_OBJ)))
;This sets the width of the MTEXT box to 75X the text height.
;This value may need to be adjusted to suit your needs.
WID(*(cdr(assoc 40(entget TXT_OBJ)))75)

PARA(strcat(cdr(assoc 1 (entget TXT_OBJ)))"P")
)
(while(setq TXT_OBJ(entsel "nSelect next TEXT string when finished selecting: "))
(setq TXT_OBJ(car TXT_OBJ))
(if(Chk_Txt TXT_OBJ)
(setq PARA(strcat PARA(cdr(assoc 1 (entget TXT_OBJ)))"P"))
(prompt "Object selected was not TEXT!")
)
)
(setq OLD_LAY(getvar "clayer"))
(setvar "clayer" MT_LAY)
(command "-MTEXT" "S" MT_STY MT_IPT "W" WID PARA "")
(setvar "clayer" OLD_LAY)
(prompt "nSelect insertion point for text paragraph: ")
(command ".move" "l" "" MT_IPT pause)
(setvar "cmdecho" U_CE)
(princ)
)

 
Posted : June 21, 2012 10:54 am
(@cptdent)
Posts: 2089
Registered
 

Lisp file

Sure hope he has the Intellicad version. Won't work in the AutoCad Embedded version.

 
Posted : June 21, 2012 10:56 am
(@pin-cushion)
Posts: 476
Registered
 

I sent you everything you need and one very important LISP I could not live without... you have everything you need to get it done... except the know how 🙂

call me back if you need to, number is still the same. I will be around... just got back from Yankee Carolina.

 
Posted : June 21, 2012 11:20 am
(@spledeus)
Posts: 2772
Registered
 

with a full cad component you use expresstools.

 
Posted : June 21, 2012 12:34 pm
(@perry-williams)
Posts: 2187
Registered
 

Carlson Text to Mtext>Ben

> How does that work, Ben?
>
> do you export and then import text?

you simply open each TEXT block, then select-copy then paste the contents into the MTEXT. Repeat as necessary.

 
Posted : June 21, 2012 3:42 pm