Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Globally changing mtext "defined width"

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
Niniat
13939 Views, 15 Replies

Globally changing mtext "defined width"

Hello all

 

Is there a way to globally change the defined width of mtext? In my situation I am receiving drawings from multiple people and quite often their mtext width boxes are humongous. To clean up our drawings we would like to be able to have the width automatically snap to the length of the text. Is there a macro or lsp routine or just a simple command that I don't know about that can help me with this? I realize that if you go into the mtext editor and double click on the width arrows in the ruler it will snap to the text but to do that for every single mtext would take aLOT of time.

 

Thanks in advance!!

 

Nina

15 REPLIES 15
Message 2 of 16
Patchy
in reply to: Niniat

Message 3 of 16
pendean
in reply to: Niniat

PROPERTIES command will let you do that if I understood your exact need (defined Width section): I do that all the time here.
Message 4 of 16
Niniat
in reply to: pendean

I have tried using the properties option and while that does change the width, it only lets me change to a uniform number as opposed to snapping the width to match the length of text

Message 5 of 16
Niniat
in reply to: Patchy

Thanks! I'll run the addon past my boss

Message 6 of 16
pendean
in reply to: Niniat

Ah! Sorry, I missed the custom-width requirement needed.
Message 7 of 16
Niniat
in reply to: pendean

The addon is a no go, we cannot install an addon to autocad within our organization unfortunately. Any other ideas?

Message 8 of 16
Niniat
in reply to: Niniat

Also in a supplementary issue... When I go into properties with my mtext highlighted, the defined width option is locked until i change the mtext column to none... is there a command I can run to have all of the mtext already in the drawing have the mtextcolumn setting as 0? Selecting the text and using the mtextcolumn command does not actually change what is already there, it just sets that setting for any new text added into the drawing. Any suggestions?

 

Nina

Message 9 of 16
Kent1Cooper
in reply to: Niniat

This has come up before.  Put reduce mtext width in the Search window, and the first couple of threads in the list are on just this question.  [I haven't dug into them to see whether they contain good solutions, but if not, there are further threads you can investigate.]

Kent Cooper, AIA
Message 10 of 16
pendean
in reply to: Niniat

"...is there a command I can run to have all of the mtext already in the drawing have the mtextcolumn setting as 0? ..."
PROPERTIES as noted/dismissed earlier in this thread. You can turn off columns there too.

 

To turn off columns permanently (until you/someone else turns them on), simply start MTEXT, set it to no-columns, type a few words, end MTEXT safely.

Message 11 of 16
Niniat
in reply to: pendean

Yes i realize properties does this, I am looking for a macro or lsp that can be distributed throughout my department as opposed to a set of instructions. It is much easier to get someone to click a button than to have them follow a series of instructions for something. I did find one lsp that I am currently working with and editing that seems to be working properly, found on one of the other threads that I found.

Message 12 of 16
doni49
in reply to: Niniat


@Niniat wrote:

Yes i realize properties does this, I am looking for a macro or lsp that can be distributed throughout my department as opposed to a set of instructions. It is much easier to get someone to click a button than to have them follow a series of instructions for something. I did find one lsp that I am currently working with and editing that seems to be working properly, found on one of the other threads that I found.


So you'd be ok with using the autolisp routine?  You were previously provided with on to do this and you said the boss told you no.

 

If it's simply a matter of not wanting to provide instructions as to where to put it, how to use it etc:  put it on your network and make that location a part of the acad support path.



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 13 of 16
aksha
in reply to: Niniat

I am unable to understand how the LISP STRIPMTEXT helps setting the 'defined width' of any MTEXT.
But I have found another way to do this for multiple MTEXT objects at a time. With Properties palette open, select all the MTEXT. In the Properties palette click right of 'Defined Width'. In the 'Column Settings' dialogue box that opens up, select 'Dynamic Columns' and 'Auto Height' radio buttons under 'Column Type' box. Now you can globally edit width and height of MTEXT.

Message 14 of 16
R_Tweed
in reply to: Niniat

Mtext width and length are two separate controls. Normally one will govern over the other.  If your looking for a particular width then your length of text will either spill past your length or you will need to define columns to restrict the length.  @pendean  mentioned the properties option.. It is possible to enter the width by picking two points rather entering a number and you can also enter the length by picking points  which will change selected mtext globally using the properties palette. I'm not a lisp guy but here is something that would set width to 2. Maybe someone else can explain a pick points function. Copy the text below into notepad and save as zw.lsp.  this particular function will set your text width to 2. You could add this into a script I suppose that would select all mtext entities. that would make it a one button action.

(defun c:zw () (vlax-put (vlax-ename->vla-object (car (entsel "\nPick Mtext Object: "))) 'width 2) (princ))

Message 15 of 16
Kent1Cooper
in reply to: Niniat


@Niniat wrote:

.... we would like to be able to have the width automatically snap to the length of the text. ....


Old topic, but another approach:

 

If what is meant is the length of the text in a single line  [and they want to reduce the defined width down to that length], is there any reason it needs to be Multi-line  Text?  Just EXPLODE it into ordinary Text.  In addition to not having the defined-width issue at all, it uses less memory.  Possible reasons you might not  want to do it that way: plain Text can't stack fractions; portions of it can't be given different colors or heights or fonts.

Kent Cooper, AIA
Message 16 of 16
samjYM2DB
in reply to: Kent1Cooper

Mtext, 0-width is useful for wipeouts on text (esp. 1-word text)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost