Multi Leader Object Text Color

Multi Leader Object Text Color

Anonymous
Not applicable
2,199 Views
2 Replies
Message 1 of 3

Multi Leader Object Text Color

Anonymous
Not applicable

Hi,

 

Is there anyway to change an existing Multi leader object "Text Color" (annotation color) through some program without changing Multi Leader Style.?

 

I have tried by creating another Multi leader as i required and applied Match Properties command, but that is only changing Style of original Multi Leader object and leaving Font and Color unchanged.

 

 

This is Existing Multi Leader Object in Drawing

 

1.PNG

 

 

This is after applying Match Properties Command (the source multileader is having font:simplex, color:yellow, but those properties not transfering here) 

 

 

2.PNG

 

 This is actually my requirement

 

 

 

3.PNG

 

 

please help.

 

 

 

 

 

0 Likes
Accepted solutions (1)
2,200 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

This routine will set color of mleader text for multiple selection.

 

(vl-load-com)

(defun c:MLeaderTextColor ( / col ss obj txt x y)
  
  (if (and (setq col (getint "\nText color number: "))
           (setq ss (ssget '((0 . "MULTILEADER"))))
           )
    (repeat (setq i (sslength ss))
      (setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i))))
            txt (vla-get-TextString obj)
            txt (vl-string-trim "{}" txt))
      (foreach e '("\\C" "\\c")
        (while (and (setq x (vl-string-search e txt))
                    (setq y (vl-string-search ";" txt x)))
          (setq txt (strcat (substr txt 1 x)
                            (substr txt (+ 2 y))))))
      (vla-put-TextString obj (strcat "{\\C" (itoa col) ";" txt "}"))))
  (princ)
)
Message 3 of 3

Anonymous
Not applicable

It is working perfect.

 

BeekeeCZ >>>>>Thank you very much boss. I really admire your programming skills.

thanks a lot.

 

Smiley Happy

0 Likes