txt2mtxt
txt2mtxt
(OP)
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?
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: txt2mtxt
;;; 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 "Pick reference text"))))
(princ "Nothing selected"))
((not (= (dxf 0 (setq reftext (entget reftext))) "TEXT"))
(princ "Not a text"))
((not (setq ss (ssget)))
(princ "Nothing selected"))
(T
(setq index 0.0
mtext '((0 . "MTEXT") (100 . "AcDbEntity") (100 . "AcDbMText"))
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) "\\P"))))
)
(entdel (dxf -1 reftext))
(repeat (sslength ss)
(cond ((not
(= (dxf 0 (setq ent (entget (ssname ss index)))) "TEXT")
)
(princ "Non-text ignored")
)
(T (setq mtext (append mtext
(list (cons 3 (strcat (dxf 1 ent) "\\P")))))
(entdel (dxf -1 ent))
)
)
(setq index (1+ index))
)
(entmake (append mtext '((1 . " "))))
)
)
(princ)
)
RE: txt2mtxt
Flores