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

0 Members and 1 Guest are viewing this topic.

Hrishikesh

  • Newt
  • Posts: 35
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: 6312
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 10 x64 - AutoCAD /C3D 2018

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10222
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

  • Newt
  • Posts: 35
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 :-)