strip mtext formatting

strip mtext formatting

mruPRQUJ
Advocate Advocate
8,662 Views
58 Replies
Message 1 of 59

strip mtext formatting

mruPRQUJ
Advocate
Advocate

Hi,

 

Is it possible to create a lisp to strip mtext formatting? like, width factor, tracking and oblique angle. The attached lisp can strip mtext, but not formatting. Thank you very much in advance, 🙂

0 Likes
Accepted solutions (2)
8,663 Views
58 Replies
Replies (58)
Message 2 of 59

pendean
Community Legend
Community Legend

@mruPRQUJ wrote:

... like, width factor, tracking and oblique angle....


pendean_0-1688735135865.png

https://github.com/Fandoozle/AutoCAD/blob/master/StripMtext%20v5-0c.lsp 

Message 3 of 59

mruPRQUJ
Advocate
Advocate

Width and width factor are two different items, many thanks. 🙂

0 Likes
Message 4 of 59

john.uhden
Mentor
Mentor

@mruPRQUJ ,

In the file you included you can see what formats are covered..

;;;; Available format key codes
;;;; --------------------------
;;;; "A" = Alignment
;;;; "B" = taBs
;;;; "C" = Color
;;;; "D" = fielDs (converts fields to static text)
;;;; "F" = Font
;;;; "H" = Height
;;;; "L" = Linefeed (newline, line break, carriage return)
;;;; "M" = background Mask
;;;; "N" = columNs
;;;; "O" = Overline
;;;; "P" = Paragraph (embedded justification, line spacing, indents)
;;;; "Q" = obliQue
;;;; "S" = Stacking
;;;; "T" = Tracking
;;;; "U" = Underline
;;;; "W" = Width
;;;; "~" = non-breaking space
;;;; "*" = all formats

 

Of course I must defend Joe and Steve because I had donated the code they used in v3.0.

I still use my original UNFORMAT.LSP, but I think that STRIPMTEXT does more.

John F. Uhden

Message 5 of 59

mruPRQUJ
Advocate
Advocate

Hi,

 

Width is different with width factor. Could you please advise how to remove width factor only? Please see the image below, thank you very much! 🙂

 

width factor

mruPRQUJ_0-1688742299679.png

 

Width

mruPRQUJ_1-1688742378521.png

 

0 Likes
Message 6 of 59

pendean
Community Legend
Community Legend
Got it: standalone LISP while you wait... see comments below that for additional adjustments https://forums.autodesk.com/t5/autocad-forum/mtext-width-factor/m-p/10397965#M1054795

There are more examples you can find with a search of these forums.
Message 7 of 59

john.uhden
Mentor
Mentor

@mruPRQUJ ,

johnuhden_0-1688748211375.png

I'm sure UNFORMAT.lsp is somewhere in this database, but if you can't find it, let me know.

An older version (that may be at home) enabled you to select the overrides to remove, but I simplified it to attack all the overrides I knew 18 years ago.  It doesn't handle attributes.

Now if the improper width factor is applied to the entire contents, but there is no override, then check and maybe change the text style's properties.

John F. Uhden

Message 9 of 59

john.uhden
Mentor
Mentor

@pendean ,

I see you are filling in for @hak_vz .  😏

Yes, that's the original function from 2003.  It provides for user input as to what formatting to remove.

My later version eliminated the alpha choices.

My latest version handles MLEADERS as well.

I wonder if I should reinstate the alpha choices.

John F. Uhden

Message 10 of 59

pendean
Community Legend
Community Legend

@john.uhden wrote:

@pendean ,

I see you are filling in for @hak_vz .  😏


LOL, no, I just went down this rabbit-hole looking for something else when I stumbled across both links and remembered this post thread.

Message 11 of 59

mruPRQUJ
Advocate
Advocate

Hi,

 

Thank you very much all of you. Sorry to reply to you so late as I am busy. 

@john.uhden 

The below is the link of the lisp, 

Re: StripMText Issue - Autodesk Community - AutoCAD

 

Could you please advise me on how to use it? After loaded two version of the lisp, input 'cv_unformat' or 'unformat', neither of them works, thanks. 🙂

0 Likes
Message 12 of 59

mruPRQUJ
Advocate
Advocate

Hi,

 

Sorry to reply to you so late as I am busy. The lisp works, but I wonder if it is possible to make it better. If there are several mtext with different width factor, it only can modify one group mtext with the same width factor. Is it possible to change all mtext at one time? many thanks. 🙂

0 Likes
Message 13 of 59

mruPRQUJ
Advocate
Advocate

Hi, 

Could you please provide your latest version to me? many thanks.

0 Likes
Message 14 of 59

john.uhden
Mentor
Mentor

@mruPRQUJ ,

Do you want the old version that let's you input what formatting to remove, or the new one that just removes all formatting?

John F. Uhden

Message 15 of 59

mruPRQUJ
Advocate
Advocate

Hi, Both of them is great, they can be used for different situation. If it is not possible, I prefer the latest one, thanks a million. 🙂

0 Likes
Message 16 of 59

john.uhden
Mentor
Mentor

@mruPRQUJ ,

Then you probably want an updated version of the old one because one of the key code choices is "*" which means remove all formatting.  Note that it will have to wait until I have some spare time.

John F. Uhden

0 Likes
Message 17 of 59

mruPRQUJ
Advocate
Advocate

Hi, can I have one which is available?  I can use it for some drawings, removing all formatting is ok, I can't thank you enough. 🙂

0 Likes
Message 18 of 59

mruPRQUJ
Advocate
Advocate

Hi,

 

Can I have one which is available? Old or new one does not matter, thanks. 🙂

0 Likes
Message 19 of 59

john.uhden
Mentor
Mentor

@mruPRQUJ ,

The only version I have at hand removes all formatting, including width factors.

Do you want that?

Or would you rather wait for me to update the old version which offers a selection of key codes.

John F. Uhden

Message 20 of 59

mruPRQUJ
Advocate
Advocate

Hi,

 

That one is good, removing all formatting is ok, I can use for some drawings, thanks a lot! 🙂

0 Likes