Reduce Mtext to Actual String Width?
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Reduce Mtext to Actual String Width?

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting
Author Message
Simon
Guest





Posted: Thu Nov 18, 2004 8:57 pm    Post subject: Reduce Mtext to Actual String Width? Reply with quote

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? Reply with quote

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? Reply with quote

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? Reply with quote

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? Reply with quote

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? Reply with quote

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? Reply with quote

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? Reply with quote

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? Reply with quote

It worked??? cool. You're welcome.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB