0 Members and 1 Guest are viewing this topic.
(vl-load-com)(vla-setfont (vla-item (vla-get-textstyles (setq adoc (vla-get-activedocument (vlax-get-acad-object)))) "Standard" ;style )"ARIAL" ;font:vlax-false ;bold:vlax-true ;italic0 ;charset(+ 2 64) ;font family)(vla-regen adoc acallviewports)
change the text style of selected text from simplex to arial black?
(defun c:foo ( / e i s ) (if (setq s (ssget "_:L" '((0 . "TEXT,MTEXT") (7 . "SIMPLEX")))) (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i))))) (entmod (subst '(7 . "Arial Black") (assoc 7 e) e)) ) ) (princ))
btw. i meant font, not style.. sorry for the confusion. i was in a hurry
ill just change it over to mtext and do it manually
(setq txtstyle (vla-item (vla-get-textstyles adoc) "Standard"));<-- set your style name here (if (not (equal (strcase (vla-get-fontfile txtstyle)) "TIMES.TTF")) (vl-catch-all-apply '(lambda () (progn (setq fontfile (findfile (strcat (getenv "WINDIR") "\\fonts\\times.ttf"))) (vla-put-fontfile txtstyle fontfile) ) ) ) )
Quote from: andrew_nao on January 15, 2013, 11:08:56 AMill just change it over to mtext and do it manually Just change the font applied to the Text Style and this change will be reflected across all Text objects referencing the style.
Quote from: andrew_nao on January 15, 2013, 11:08:56 AMbtw. i meant font, not style.. sorry for the confusion. i was in a hurry Andrew you should know that the font in plain text can only be changed by changing the STYLE.You can create a new Style for your desired font or use an existing style.
Quote from: andrew_nao on January 15, 2013, 11:08:56 AMbtw. i meant font, not style.. sorry for the confusion. i was in a hurry Try this code for your style: Code: [Select](setq txtstyle (vla-item (vla-get-textstyles adoc) "Standard"));<-- set your style name here (if (not (equal (strcase (vla-get-fontfile txtstyle)) "TIMES.TTF")) (vl-catch-all-apply '(lambda () (progn (setq fontfile (findfile (strcat (getenv "WINDIR") "\\fonts\\times.ttf"))) (vla-put-fontfile txtstyle fontfile) ) ) ) )