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
Solved! Go to Solution.
Solved by aksha. Go to Solution.
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
The addon is a no go, we cannot install an addon to autocad within our organization unfortunately. Any other ideas?
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
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.]
"...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.
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.
@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
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.
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))
@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.