- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Hi, everyone.
There're a ton of MText elements where I would like to replace a specific set of characters, say "__" (double underscores) with a carriage return.
Forums around the web say to replace it with "\P" (case sensitive), but this does not work. When I replace them with "\P", the Mtext actually shows the "\P" in there, instead of inserting a carriage return.
And, if you select the Mtext and look at "Contents" property it shows "\\P" (double backslashes).
For example:
- Initial Mtext: "TOP LINE__BOTTOM LINE"
- Find/Replace "__" with "\P"
- Mtext result: "TOP LINE\PBOTTOM LINE"
- "Contents" property: "TOP LINE\\PBOTTOM LINE"
Does anyone know how to accomplish this?
Thanks in advance,
Edgar
¡Resuelto! Ir a solución.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Try replacing it with "\\P" with the double backslash. A backslash is a control character, and to get it to read it as a backslash, it needs another. Even though in the Properties palette display of contents it may show like this:
THIS IS\PA TEST
if you look at the actual content as stored in entity data, it looks like this:
(1 . "THIS IS\\PA TEST")
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Hi, Kent. Thanks for the tip... but it didn't work...
If we replace it instead with "\\P", then the Mtext shows "TOP LINE\\PBOTTOM LINE" and the "Contents" property shows something like this: "TOP LINE\\\\PBOTTOM LINE" (four backslashes).
But here, I found this forum where Rodolfo found the answer: "Add an 'Enter' using Find and Replace" - instead of "\P" we should use the Unicode "\U+000A". I just tested it and it works!!! ![]()
Either way, thanks again for the tip, Kent - your help has always been awesome!
Edgar
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
It is still a pain in the but to find/replace Mtext in autocad even with the "\U+000A" function (which it does work), especially when you have to edit a lot of drawings through a lisp routine. The problem I face then, although the text have been replaced, it makes it a weird format, until you go into that mtext edit and exit afterwards without editing, and then the layout will readjust to the correct format.
Above is an example before going into the editor, and below is what happens if I do what I have described
Please take note I haven't made any changes except going into the editor and exiting. It is a bit annoying to fix the layout, I hope the devs can make our lives a lot easier with a patch to fix this issue.