Change all different textheights within several mtexts into one textheight

Change all different textheights within several mtexts into one textheight

sander.van.pelt
Advocate Advocate
851 Views
8 Replies
Message 1 of 9

Change all different textheights within several mtexts into one textheight

sander.van.pelt
Advocate
Advocate

Hello everyone,

 

What is the quickest and easiest way to change all text heights in all mtexts objects in a drawing to one height?


If I select all these objects, I can change the text height in the properties palette, I understand that.

But if words or sentences within the mtext have been manually adjusted to a different height, so that you have multiple text heights within 1 mtext, this will not change.
Suppose I create a multiline text with a text height of 50. I type 1 word with a text height of 50 and 1 of 25 and I'm done.
If I want to change the text height to 100 (in this case twice as large) and I change that in the properties, the word with a text height of 50 will become 100. The word with a height of 25 will only becomes twice as large. So it won't be 100.

To change all the content of the mtext objects to 1 height, I would have to do this manually.

Can I solve this with a standard AutoCad command, or does anyone have a lisp for this?

 

Thanks

0 Likes
Accepted solutions (3)
852 Views
8 Replies
Replies (8)
Message 2 of 9

ВeekeeCZ
Consultant
Consultant
Accepted solution

I suggest using StripMtext to remove the manual edits first... then you can use the Property Palettes or style setting.

You will have to have LISPSYS set 0.

0 Likes
Message 3 of 9

sander.van.pelt
Advocate
Advocate

Thank you (Again) BeekeeCZ. This lisp is exactly what I was looking for.
Nice that you can really change everything from the mtext objects to how you have entered it in the properties palette.
I haven't had to deal with this yet, but maybe one day I'll come across multiple mtext objects with multiple fonts, different colors, or other unique properties that all have to have the same properties.

Message 4 of 9

sander.van.pelt
Advocate
Advocate

Hello BeekeeCZ,
Still a question about the Striptext_v5.0d.lsp.
If I remove all text properties from an Mtext, everything except the strike-through words is removed.
How can I edit a command or add a lisp command beneath a button in the menu to remove these line(s)? Or create a new button with this function?

The lisp contains these strings to remove the overlines and underlines:

;; O format
(defun Overline (str) (RE:Replace "" "\\\\[Oo]" str)) and
;; U format
(defun Underline (str) (RE:Replace "" "\\\\[Ll]" str))

What string do I need to remove the strike-through/ what should I replace [Ll] or [Oo] for?

 

Thanks

0 Likes
Message 5 of 9

ВeekeeCZ
Consultant
Consultant
Accepted solution

Kk, see

 

BeekeeCZ_1-1670420074565.png

 

Or see the list HERE 

 

 

 

Message 6 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

Here's a text string including some Strikethrough:

 

(1 . "this is a test of {\\Kstrikethrough} vs {\\Ooverline} vs {\\Lunderline} content")

 

So try the same format using [Kk] in place of the [Oo] and [Ll].

Kent Cooper, AIA
Message 7 of 9

sander.van.pelt
Advocate
Advocate

Thanks Kent1Cooper and BeekeeCZ,

If I change the string into 

;; K format
(defun Strikethrough (str) (RE:Replace "" "\\\\[Kk]" str)) the line through the text will be deleted.

0 Likes
Message 8 of 9

sander.van.pelt
Advocate
Advocate

@Kent1Cooper and @ВeekeeCZ,

 

How can I create a dialog box like the StripMtext box but with other functions? At my work, everybody needs to "clean" a drawing/ floorplan at the same way;
Dimensions need to be placed into Layer A, the (m)text into Layer B, walls need to place into Layer C and most have a specific color, some new layers need to be created and layers and colors in a block needs to be the same as the blocklayer.
Some of these options are just AutoCAD commands, but other are Lisp commands.

But sometimes we do not need to use or may not use one or these options.
That's why I also want the options to select one by one, all at once or deselect all.

How can I create this dialog or do you have a link to a site where it is explained step by step how I can make this dialog box?

Thanks

0 Likes
Message 9 of 9

ВeekeeCZ
Consultant
Consultant

HERE see the Dialog Box Tutorial section. That is a good place to start. It's called DCL.

0 Likes