How to FIND and REPLACE mtext fractions like 2-1/2" and change to 3"

How to FIND and REPLACE mtext fractions like 2-1/2" and change to 3"

EBSPEAMD
Contributor Contributor
2,423 Views
11 Replies
Message 1 of 12

How to FIND and REPLACE mtext fractions like 2-1/2" and change to 3"

EBSPEAMD
Contributor
Contributor

Hello all.

 

Hoping someone can help.  I need to swap a bunch of 2-1/2" in mtext to 3" and I would rather do it via the search function than trying to find every single one and changing it manually.  Problem is, AutoCAD doesn't seem to do that.  I've been searching online and found the superstr.lsp but I can't get it to work.  All I get is the following error -"Updated 0 text string; error: AutoCAD variable setting rejected: "OSMODE" nil"

 

Not sure if there is a fix for this or just to do it the hard way.  Any help would be greatly appreciated.

Thanks!

0 Likes
2,424 Views
11 Replies
Replies (11)
Message 2 of 12

pendean
Community Legend
Community Legend
0 Likes
Message 3 of 12

EBSPEAMD
Contributor
Contributor

Hi pendean

 

0 Likes
Message 4 of 12

imadHabash
Mentor
Mentor

Hi,

Find and replace work fine !!! check your search option as shown below . 

 

Capture.PNG

Imad Habash

EESignature

0 Likes
Message 5 of 12

EBSPEAMD
Contributor
Contributor

That doesn't work on mine.  I'm using 2019 - just for point of reference.

All I get is it saying it can't find it the 2 1/2" is in Mtext and it looks like this:

mtext.jpg

 

0 Likes
Message 6 of 12

Kent1Cooper
Consultant
Consultant

@EBSPEAMD wrote:

....  I need to swap a bunch of 2-1/2" in mtext to 3" ....


Are the ones with fractions actually shown in that format [in which case FIND should work as @imadHabash illustrated]?  Or are they stacked?  [Crossed in the mail -- answered by preceding Message.]

Kent Cooper, AIA
0 Likes
Message 7 of 12

imadHabash
Mentor
Mentor

i think that first you have to Remove All formatting from your mtext . see  Contents in your image

Imad Habash

EESignature

0 Likes
Message 8 of 12

EBSPEAMD
Contributor
Contributor

So in order to replace the text, I need to remove the formatting when I'm trying to do the find and replace drawing-wide?  I would have to go through and individually select the mtext to do that - I don't want to remove the formatting on my other stacked fractions.

 

Somehow the manual way seems easier than that.

0 Likes
Message 9 of 12

Kent1Cooper
Consultant
Consultant

@imadHabash wrote:

i think that first you have to Remove All formatting from your mtext . see  Contents in your image


Only the fraction-stacking formatting.  Try StackStyleForce.lsp with its SSF command, available >here<.  Choose the None option, and all stacked fractions [throughout the drawing]  will be un-stacked.  Then FIND can be used to do your replacement.  If you like, you can then use SSF again, selecting a different stack style, to re-stack all other fractions.  Read the comments -- it's pretty comprehensive [applies the chosen stacking style to not only all Mtext content but also all Dimension Styles].

Kent Cooper, AIA
Message 10 of 12

EBSPEAMD
Contributor
Contributor

@Kent1Cooper 

I get this error "Stacking style [Horizontal/Diagonal/None/Tolerance] <N>: N; error: bad argument value: positive 0"

 

😞

0 Likes
Message 11 of 12

Kent1Cooper
Consultant
Consultant

@EBSPEAMD wrote:

I get this error "Stacking style [Horizontal/Diagonal/None/Tolerance] <N>: N; error: bad argument value: positive 0" ....


I'm not sure where that could be coming from.  I was going to ask whether there are no  objects containing stacked fractions, but the message is different in that case, and does not cause an error.  It was written under Acad2004, but still works for me in 2019.  Are you using a newer version than that, in which case there might possibly be something that now works differently?  [My first guess would be a difference in the DIMFRAC System Variable values, but they appear to still be the same.]

 

BUT I was partially wrong earlier, anyway, so it may be only a partial solution for you even if it works -- I'm afraid it doesn't  re-stack fractions in Mtext or Dimension override text content.  It only assigns the chosen stack style to all Dimension Style definitions.  I had forgotten that its work in Mtext & override Dimension text depends on finding stacking-type control codes, so once they've been removed, it won't recognize those Mtext objects as containing fractions that should be stacked.  I'll have to think about whether that can be incorporated, since it seems useful, and essential to what you want to do. [EDIT:  In fact, I find I have a copy with a slightly different name, for working on it, in which I had already raised the question.  The first complication is in finding the stacking characters and differentiating those that are parts of fractions from those that are not, but even after that, there are other challenges in putting the code characters in, when there could be others around.]

Kent Cooper, AIA
0 Likes
Message 12 of 12

EBSPEAMD
Contributor
Contributor

So I've hit the proverbial cluster nugget.  I appreciate the attempt @Kent1Cooper.  I definitely don't want to unstack all of my fractions and then have to manually fix them all. 

0 Likes