Author Topic: Problem Mtext color is not changing by Auto lisp???  (Read 1510 times)

0 Members and 1 Guest are viewing this topic.

Hrishikesh

  • Guest
Problem Mtext color is not changing by Auto lisp???
« on: July 13, 2017, 10:47:06 AM »
Hi All,
I am facing a small problem regarding changing color of mtext.
If the mtext color is set from mtext editor, Autolisp is not changing color of that particular mtext.
Can anybody help me on this issue?
Screenshot & Lisp is attached.

Code - Auto/Visual Lisp: [Select]
  1. (defun C:Change_Mtext_Color (/ en)
  2.  (setq en (car (entsel "\nSelect Mtext")))
  3.  (setq en (vlax-ename->vla-object en))
  4.  (if (= "AcDbMText" (vla-get-objectname en))
  5.   (vla-put-color en 2)
  6.  ) ;_ end of if
  7. ) ;_ end of defun
  8.  
  9. (defun C:Change_Mtext_Color1 (/ en)
  10.  (setq en (car (entsel "\nSelect Mtext")))
  11.  (setq elist (entget en))
  12.  (setq elist (subst (cons 62 2) (assoc 62 elist) elist))
  13.  (entmod elist)
  14.  (entupd en)
  15. ) ;_ end of defun
  16.  

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Problem Mtext color is not changing by Auto lisp???
« Reply #1 on: July 13, 2017, 11:13:56 AM »
Do a search for 'stripmtext'.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Hrishikesh

  • Guest
Re: Problem Mtext color is not changing by Auto lisp???
« Reply #3 on: July 13, 2017, 02:39:57 PM »
Hey Thanks!!!
This not only solve my problem but it' other options will help me a lot in my daily work also.
Now I have a powerful weapon to deal with "MTEXT"

Thanks Again...
-Hrishikesh :-)