×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

txt2mtxt

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?

RE: txt2mtxt

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 "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

The Express Tools are included on the 2004 CD.

Flores

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources