TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Hrishikesh on July 13, 2017, 10:47:06 AM

Title: Problem Mtext color is not changing by Auto lisp???
Post by: Hrishikesh 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.  
Title: Re: Problem Mtext color is not changing by Auto lisp???
Post by: ronjonp on July 13, 2017, 11:13:56 AM
Do a search for 'stripmtext'.
Title: Re: Problem Mtext color is not changing by Auto lisp???
Post by: CAB on July 13, 2017, 01:21:07 PM
Got my trusty index handy.

--------------  Strip MText  ----------------
https://www.theswamp.org/index.php?topic=31584.0
https://www.theswamp.org/index.php?topic=17185.0
https://www.theswamp.org/index.php?topic=14764.0
Title: Re: Problem Mtext color is not changing by Auto lisp???
Post by: Hrishikesh 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 :-)