Modify mtext paragraph in 300 drawings

Modify mtext paragraph in 300 drawings

townest
Advocate Advocate
909 Views
7 Replies
Message 1 of 8

Modify mtext paragraph in 300 drawings

townest
Advocate
Advocate

What would be a best practice for modifying an mtext paragraph (same pat phrase, same insert coordinates) that get updated every so often) in many drawings?  I have successfully used a lisp to just insert and redefine the text as a block, but not sure it's the best tactic.  Thank you.

0 Likes
910 Views
7 Replies
Replies (7)
Message 2 of 8

CodeDing
Advisor
Advisor

@townest ,

 

Is it possible for you to XREF it? That way it could automatically be "redefined" every time somebody opens the drawing.

 

Best,

~DD

Message 3 of 8

townest
Advocate
Advocate

No, I need the object in the drawing.  Thank you.  

0 Likes
Message 4 of 8

CodeDing
Advisor
Advisor

@townest ,

 

If you cannot use XREFs then I would say that you are currently using the best tactic. A block is the next best option.

 

Best,

~DD

0 Likes
Message 5 of 8

pbejse
Mentor
Mentor

@townest wrote:

What would be a best practice for modifying an mtext paragraph (same pat phrase, same insert coordinates) that get updated every so often) in many drawings?  I have successfully used a lisp to just insert and redefine the text as a block, but not sure it's the best tactic.  Thank you.


 

To change the value without redefining any blocks or even opening the drawing.

I'll start with this.. 

import to mtext.png

Select you text file..

 

select text.png

 

and there you have it... 

 

HTH

 

0 Likes
Message 6 of 8

ronjonp
Mentor
Mentor

The best practice for something like this is an XREF as @CodeDing mentioned. Why can you not use an xref? You're making unnecessary work for yourself.

0 Likes
Message 7 of 8

SeeMSixty7
Advisor
Advisor

@ronjonp Just 300 times more work. GRIN!

Message 8 of 8

Sea-Haven
Mentor
Mentor

Each paragraph in mtext is a string of words as you know where you put it you could make a list of all the paragraph strings, go through them if = then substitute that entry in list and update the mtext you only need 1 character out of place and it will fail. Use the delimeter \\p

 

;   TextString = "EACH PARAGRAPH IN MTEXT IS A STRING\\POF WORDS AS YOU KNOW WHERE YOU PUT IT\\PYOU COULD MAKE A LIST OF ALL THE PARAGRAPH STRINGS,\\PGO THROUGH THEM IF = THEN SUBSTITUTE\\PTHAT ENTRY IN LIST AND UPDATE THE MTEXT\\PYOU ONLY NEED 1 CHARACTER OUT OF PLACE AND IT WILL FAIL. "
;

If its a couple of words what about find replace not Autocads but a lisp.

0 Likes