Results 1 to 9 of 9

Thread: Reduce Mtext to Actual String Width?

  1. #1
    Simon Guest

    Reduce Mtext to Actual String Width?

    Hi all,

    Is there a way to quickly reduce Mtext entities to the actual width of the
    text string? I've got lots of short strings (one word) with big paragraph
    widths, i.e. the grips extend far beyond the actual text. MatchProp is ok,
    but doesn't really reduce widths to the actual string length.

    Simon.

  2. #2
    Kate M Guest
    Set width to 0? If they're all one line anyway...

  3. #3
    Simon Guest
    Thanks, Kate. I have hundreds of these "one liners" at different
    orientations so MatchProp isn't ideal. Is there better method to use?

    Simon.

  4. #4
    Dean Saadallah Guest
    PROPERTIES command, select them all, change the width setting.

    --
    Dean Saadallah
    Add-on products for LT
    http://www.pendean.com/lt
    --

  5. #5
    Simon Guest
    Perfect:)

    Thank-you Dean.

  6. #6
    C Witt Guest
    you could also use this (see attached).. I made it for use with
    multi-line mtext, but it works just as well on single line mtext.

    Simon wrote:
    Perfect:)

    Thank-you Dean.

  7. #7
    OLD-CADaver Guest
    Lesee'
    Assoc code 41 is the mtext width (distance between grips)
    Assoc code 42 is supposedly the width of the actual words
    So this might work (completely untested):


    (defun c:mtww ()
    (command ".undo" "BEGIN")
    (setvar "cmdecho" 0)
    (setq
    old (ssget)
    setlgth (sslength old)
    co -1
    t2 "t"
    )
    (while (boundp 't2)
    (progn
    (setq
    co (1+ co)
    temp (entget (ssname old co))
    newtext (subst (cons 41 (cdr (assoc 42 temp))) (assoc 41 temp) temp)
    t2 (ssname old (1+ co))
    )
    (entmod newtext)
    )
    )
    (setq co (1+ co))
    (command ".undo" "END")
    (princ)
    )

  8. #8
    Simon Guest
    Both of these work great, and are even quicker than the prop palette.

    Thanks very much, C Witt & OLD-CADaver:)

  9. #9
    OLD-CADaver Guest
    It worked??? cool. You're welcome.

Similar Threads

  1. How to reduce filesize...
    By malik641 in forum AutoCAD
    Replies: 2
    Last Post: 06-24-2006, 08:55 PM
  2. Zoom to actual
    By Randy Story in forum SolidWorks
    Replies: 3
    Last Post: 05-07-2005, 11:24 PM
  3. Setting MText Width via LISP
    By JRodriguez in forum Customization
    Replies: 12
    Last Post: 01-07-2005, 11:26 AM
  4. MText Actual Width and Actual Height
    By Joseph Pods in forum VBA
    Replies: 4
    Last Post: 12-27-2004, 04:26 PM
  5. Mtext Width Factor
    By hulioman in forum AutoCAD
    Replies: 1
    Last Post: 12-16-2004, 04:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum