Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

txt2mtxt 1

Status
Not open for further replies.

ccable

Mechanical
Dec 22, 2003
24
Anybody know how to convert single line text to multi line text. txt2mtxt used to work in 2000 but doesnt work in 2004 it was an express tool and thee arent any with 2004. Any suggestions?
 
Replies continue below

Recommended for you

Got this off the web, haven't tried it myself:

;;; Text2MText
;;; (c) 1995 CR/LF GmbH, Essen/Germany
;;; Custom AutoCAD Programming since 1986
;;;
;;; CR/LF GmbH -----------
;;; Obere Fuhr 27 | CR / | |
;;; D-45136 Essen || / LF | |
;;; Tel.: ++49 201 254566 || <-------+ |
;;; Fax: ++49 201 256669 | -----------
;;; CIS: 100015,1632 -----------
;;; Internet: 100015.1632@CompuServe.com
;;;
;;; This program is copyrighted. It may be distributed freely however.
;;;
;;; Benefit:
;;; This file implements an AutoCAD command to combine selected text lines
;;; to a single mtext object.
;;;
;;; Usage:
;;; Load this file with AutoCAD's APPLOAD command.
;;; Enter TEXT2MTEXT.
;;; Pick the reference text. The mtext object will use this entity's
;;; properties including style, text height, layer a.s.o.
;;; Select the other text entities to append to the reference text.
;;; Done.
;;;
;;; Restrictions:
;;; Select the text to combine by clicking. Using crossing or windowing
;;; may result in an unwanted text sequence.
;;;

(defun c:text2mtext (/ dxf ss index ent mtext)
(defun dxf (tag obj) (cdr (assoc tag obj)))
(cond
((not (setq reftext (car (entsel &quot;Pick reference text&quot;))))
(princ &quot;Nothing selected&quot;))
((not (= (dxf 0 (setq reftext (entget reftext))) &quot;TEXT&quot;))
(princ &quot;Not a text&quot;))
((not (setq ss (ssget)))
(princ &quot;Nothing selected&quot;))
(T
(setq index 0.0
mtext '((0 . &quot;MTEXT&quot;) (100 . &quot;AcDbEntity&quot;) (100 . &quot;AcDbMText&quot;))
mtext (append mtext
(list (assoc 8 reftext) (assoc 10 reftext)
(assoc 7 reftext) (assoc 40 reftext)
(cons 41 (abs (- (caar (textbox reftext))
(caadr (textbox reftext)))))
(cons 3 (strcat (dxf 1 reftext) &quot;\\P&quot;))))
)
(entdel (dxf -1 reftext))
(repeat (sslength ss)
(cond ((not
(= (dxf 0 (setq ent (entget (ssname ss index)))) &quot;TEXT&quot;)
)
(princ &quot;Non-text ignored&quot;)
)
(T (setq mtext (append mtext
(list (cons 3 (strcat (dxf 1 ent) &quot;\\P&quot;)))))
(entdel (dxf -1 ent))
)
)
(setq index (1+ index))
)
(entmake (append mtext '((1 . &quot; &quot;))))
)
)
(princ)
)

 
The Express Tools are included on the 2004 CD.

Flores
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor