Hi, I'm trying to create a lisp that changes the color of some MTEXT, without user input from whatever color to black. I have tried several scripts found throughout the forums but none give me the result I am looking for. I dont really understand them either, I thought it would be as simple as editing their dxf codes but does general color not have a code??
Solved! Go to Solution.
Solved by dlanorh. Go to Solution.
The general color does, but if that's ByLayer, it doesn't appear in the entity data list. I don't have AutoCAD where I am at the moment, but I think it's the 6 code -- assign some override color to something and look at its entity data to find out. You can (append) an entry onto the entity data list, rather than (subst) one into it, and (entmod) to make the change, something like [untested]:
(entmod (append TheEntityDataList '((6 . 7))))
[if my 6 recollection is correct] -- 7 is the color number for black [or white if on a black background].
However, MTEXT can also contain internal color overrides, which that won't change. If that's the issue, Search for STRIPMTEXT for a routine to eliminate such internal overrides.
I think I have tested that correctly, not to sure not the best at lisp. I get this error; bad DXF group: (6 . 7) :error#0
Heres the code I used
Can't find what you're looking for? Ask the community or share your knowledge.