Mtext Width Factor

Mtext Width Factor

MarkFitz
Collaborator Collaborator
55,639 Views
18 Replies
Message 1 of 19

Mtext Width Factor

MarkFitz
Collaborator
Collaborator

Good morning everyone,

 

A quick one today.  It's been about a decade since I worked with ACAD, so I'm sure this is simple.  I used to use the width factor to adjust text to fit my page.  Pick whatever text was necessary on an individual basis.  I see width factor is now a part of style, but this changes all my text, not just the individual items I want to change.

Solutions?

 

Thanks,

 

Mark

0 Likes
55,640 Views
18 Replies
Replies (18)
Message 2 of 19

pendean
Community Legend
Community Legend
Accepted solution
use PROPERTIES command if you only wish to affect one or a few text items instead of all of them by changing the default as you have done.
Message 3 of 19

MarkFitz
Collaborator
Collaborator

WIDTH FACTOR isn't an option any more in PROPERTIES, Dean.  I know it used to be, that's what I used to use.

0 Likes
Message 4 of 19

JasonArtley
Collaborator
Collaborator
Accepted solution

Now it is hiding up in the ribbon! Double click on your mtext, Expand the formatting tab on the ribbon, and you'll see width factor at the bottom. 

 

WF.jpg

Message 5 of 19

pendean
Community Legend
Community Legend
Accepted solution

TEXT (if it's one word or one line why use mtext)

1.png

 

MTEXT

2.png

Message 6 of 19

MarkFitz
Collaborator
Collaborator

Thanks Jason.

Can you possibly show that again, but with a little bigger screen shot please.  I'm a keyboard commands kinda guy, and can't find the right button.  I'm looking under MText and don't see what you see.

 

Cheers,

 

Mark

0 Likes
Message 7 of 19

MarkFitz
Collaborator
Collaborator

Forgive my ignorance (pictures are great, thanks guys), but my menu across the top stops at Express Tools, I have no text editor, no featured apps, no performance.  Are these things I need to check to "unlock" so I can use them?

 

Thanks guys, sorry if I'm coming across as hostile or ignorant, there have been a few changes since I last used this, all positive ones so far.

0 Likes
Message 8 of 19

JasonArtley
Collaborator
Collaborator
Accepted solution

Which version of the software are you using? Do you have any Ribbons at the top of the screen?

Message 9 of 19

john.vellek
Alumni
Alumni
Accepted solution

Hi @MarkFitz,

 

If you start the Mtext command, the Ribbon menu will change (context sensitive menu). the 2nd panel from the left is called Formatting and has a little drop-down arrow. If you click on it you will find the formatting option for WIDTH.

 

Please select the Accept as Solution button if my post fully solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 10 of 19

MarkFitz
Collaborator
Collaborator

2016 straight/regular AutoCAD   Yes, there are ribbons at the top: home, insert, annotate, parametric, view, manage, output, add-ins, a360, and express tools.

0 Likes
Message 11 of 19

MarkFitz
Collaborator
Collaborator

Aha!    Look at that.

Sometimes the simplest thing eludes us.

Now I have it, many, many thanks.

 

Kudos to everyone, but how do I assign a solution when everyone did their part as a team...

0 Likes
Message 12 of 19

Anonymous
Not applicable

Just an FYI in 2018 the Width Factor is NOT present in properties menu when using Mtext. It's there for Text and Attribute Definitions which I find odd. Why is it only missing in Mtext where it's most used?

0 Likes
Message 13 of 19

john.vellek
Alumni
Alumni

Hi @Anonymous

 

The width option is found in the Ribbon  in the formatting panel.

 

Capture.PNG

 

Width factor is typically assigned in the text style. IN my opinion, the width factor in the formatting panel is used more to apply a width override.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 14 of 19

Anonymous
Not applicable

The method now known is for changing one Mtext at a time. Thanks for your advise but am wondering whether there is away of changing width factor for several Mtexts at once? 

Message 15 of 19

RobDraw
Mentor
Mentor

Then you should start a new thread. This one is marked as solved and your question is different. Slightly, but still different.

 

Have you checked your text style?


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes
Message 16 of 19

Kent1Cooper
Consultant
Consultant

It seems closely-enough related that someone looking for the same thing may find this topic.  For Mtext that is not already given a width-factor override starting at the beginning of it, this [one way of doing it -- there are others] in simplest terms seems to work:

(defun C:MTW ; = MText Width
  (/ ss wf n mt)
  (if
    (and
      (setq ss (ssget "_:L" '((0 . "MTEXT"))))
      (setq wf (getreal "\nWidth Factor to apply: "))
    ); and
    (repeat (setq n (sslength ss)); then
      (setq mt (ssname ss (setq n (1- n))))
      (setpropertyvalue mt "Contents"
        (strcat "{\\W" (rtos wf 2) ";" (getpropertyvalue mt "Contents") "}")
      ); setpropertyvalue
    ); repeat
  ); if
  (princ)
); defun

I tried it with Mtext that has internal width-factor applied to part of it not at the beginning, and with Mtext that starts out with a color override, and it worked.  I haven't tried anything close to all possible combinations of Mtext-editor override possibilities, so there may be cases where it doesn't.

 

Note that (rtos) will return the width factor as a text string to the number of decimal places in your current Units setting [LUPREC System Variable].  If that might be fewer than your typed entry, it will round it [i.e. if you have LUPREC set to 2 decimal places, and you enter a width factor of 2.125, it will become "2.13"].  If that's a risk you care about, you can add the maximum precision of 8 decimal places in the routine:  (rtos wf 2 8) .  That will usually put extraneous zeros in the Contents [but they won't affect the outcome], unless you set the DIMZIN System Variable to a value that suppresses trailing zeros [read about it in Help].

Kent Cooper, AIA
0 Likes
Message 17 of 19

Anonymous
Not applicable
How do execute this command globally to adjust all my Mtexts to a desired value?
0 Likes
Message 18 of 19

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
How do execute this command globally to adjust all my Mtexts to a desired value?

Change this line:

(setq ss (ssget "_:L" '((0 . "MTEXT"))))

to this:

(setq ss (ssget "_X" '((0 . "MTEXT"))))

I'm not sure of a way [there may be one] to combine the X-for all and :L-for-not-on-Locked-Layer modes in one selection.  If that's a concern, it could be made to find them all, and check each for being on an unlocked Layer before changing its width factor.

Kent Cooper, AIA
0 Likes
Message 19 of 19

Owackenreuther
Advocate
Advocate

@Kent1Cooper, the LISP that you provided does not work if the MTEXT width does not equal to 1. This is because the contents of the MTEXT changes if the width does not equal to 1.

I was trying to update your LISP with a IF but I did not get it to work.

Any idea how this can be fixed?

 

		(repeat (setq n (sslength ss))
			(setq mt (ssname ss (setq n (1- n))))
			(if (= (vl-string-search (getpropertyvalue mt "Contents") ";") nil)
				(setpropertyvalue mt "Contents"
				(strcat "{\\W" (rtos wf 2) ";" (getpropertyvalue mt "Contents") "}")
				)
				(setpropertyvalue mt "Contents"
					(setq idx (vl-string-position (ascii ";") (getpropertyvalue mt "Contents")))
					(setq txt2 (substr ((getpropertyvalue mt "Contents") (idx +1) (n-idx-1))))
					(strcat "{\\W" (rtos wf 2) ";" (txt2) "}")
				)
			)
		)
0 Likes