| Author |
Message |
Simon
Guest
|
Posted:
Thu Nov 18, 2004 8:57 pm Post subject:
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.
|
|
| Back to top |
|
 |
Kate M
Guest
|
Posted:
Thu Nov 18, 2004 9:00 pm Post subject:
Re: Reduce Mtext to Actual String Width? |
|
|
| Set width to 0? If they're all one line anyway... |
|
| Back to top |
|
 |
Simon
Guest
|
Posted:
Thu Nov 18, 2004 9:11 pm Post subject:
Re: Reduce Mtext to Actual String Width? |
|
|
Thanks, Kate. I have hundreds of these "one liners" at different
orientations so MatchProp isn't ideal. Is there better method to use?
Simon.
|
|
| Back to top |
|
 |
Dean Saadallah
Guest
|
Posted:
Thu Nov 18, 2004 9:13 pm Post subject:
Re: Reduce Mtext to Actual String Width? |
|
|
PROPERTIES command, select them all, change the width setting.
--
Dean Saadallah
Add-on products for LT
http://www.pendean.com/lt
-- |
|
| Back to top |
|
 |
Simon
Guest
|
Posted:
Thu Nov 18, 2004 9:22 pm Post subject:
Re: Reduce Mtext to Actual String Width? |
|
|
Perfect:)
Thank-you Dean. |
|
| Back to top |
|
 |
C Witt
Guest
|
Posted:
Thu Nov 18, 2004 10:48 pm Post subject:
Re: Reduce Mtext to Actual String Width? |
|
|
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:
| Quote: | Perfect:)
Thank-you Dean.
|
|
|
| Back to top |
|
 |
OLD-CADaver
Guest
|
Posted:
Thu Nov 18, 2004 11:37 pm Post subject:
Re: Reduce Mtext to Actual String Width? |
|
|
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)
) |
|
| Back to top |
|
 |
Simon
Guest
|
Posted:
Fri Nov 19, 2004 12:12 am Post subject:
Re: Reduce Mtext to Actual String Width? |
|
|
Both of these work great, and are even quicker than the prop palette.
Thanks very much, C Witt & OLD-CADaver:) |
|
| Back to top |
|
 |
OLD-CADaver
Guest
|
Posted:
Fri Nov 19, 2004 1:08 am Post subject:
Re: Reduce Mtext to Actual String Width? |
|
|
| It worked??? cool. You're welcome. |
|
| Back to top |
|
 |
|
|
|
|