Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change color of MTEXT

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
962 Views, 4 Replies

Change color of MTEXT

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??

4 REPLIES 4
Message 2 of 5
Kent1Cooper
in reply to: Anonymous

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.

Kent Cooper, AIA
Message 3 of 5
Anonymous
in reply to: Kent1Cooper

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

Message 4 of 5
dlanorh
in reply to: Anonymous

dxf color group code is 62 so that should be (62 . 7)

I am not one of the robots you're looking for

Message 5 of 5
Anonymous
in reply to: dlanorh

Awesome, thank you guys for the help!

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta