@Anonymous wrote:
Hey,
I have a bunch of arch drawings where I need to convert everything to colour 253 for our x-refs. The issue is that these arch drawings contain blocks within blocks and many of the blocks are x-clipped (makes a mess if I try exploding or bursting). I found a great lisp (https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-colour-change-for-lisp/td-p/1629195 ) which will change everything in a block to a certain colour, unfortunately it doesn't work for some of the nested blocks that contain text.
Everything I've read says to use ATTSYNC or BATTMAN, but these blocks don't have attributes.
I've attached a drawing of some of the text that I'm struggling with. Any help is appreciated!
Cody
You're most-likely dealing with MTEXT that has local formatting for color, similar to how text can be formatted with different colors in Word or most other word-processing apps.
The problem is not unsolvable, but it can be fairly-complicated, especially if you take the (entget)/(entmod) route, which is complicated by the possibility that there can be large amounts of mtext that are distributed over multiple DXF group 3 elements, and formatting codes could be distributed across multiple group codes as well.
Basically, color is specified in MTEXT with the formatting code "{\Cnnn;some text}". This causes 'some text' to have the color whose ACI index is 'nnn'. So for example, the word RED has the color red in the text: "This mtext contains {\C1;RED} text".
So you would have to search for and replace (or remove) the color formatting codes from the mtext. If there are other kinds of local formatting (underline or special characters), a dumb strip-mtext routine will most-likely remove everything, including things that would alter the text in ways you didn't intend, so you most-likely have to use a more-specialized routine that only strips out or replaces color formatting, while leaving other formatting codes intact.