Olhado_ Posted April 23, 2009 Share Posted April 23, 2009 We like everyone to use the same font style, so we created the program below. However, there are a few cases MText especially, where the style and font might be in out of sink and so the font does not change. Is there a way to change the font file, by itself? (defun C:UpdateAllText ( / acadobject acaddocument styleROMANS ssAllText ssCount entText oldText newText) ; Set initial variables (setq acadobject (vlax-get-Acad-Object)) (setq acaddocument (vla-get-activedocument acadobject)) ; Set "Style-Romans" - If Not already created (setq styleROMANS (vla-add (vla-get-textstyles acaddocument) "Style-Romans")) (vla-put-fontfile styleROMANS "Romans.shx") (vla-put-height styleROMANS 0.000) (vla-put-obliqueangle styleROMANS 0.0) (vla-put-width styleROMANS 1.0) (if (setq ssAllText (ssget "x" '((-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") (-4 . "OR>")))) ; Get only specific entity (progn (setq ssCount (sslength ssAllText)) (while (setq entText (ssname ssAllText 0)) (setq oldText (entget entText)) (setq newText (subst (cons 7 "Style-Romans")(assoc 7 oldText) oldText)) (entmod newText) (ssdel entText ssAllText) ))) (command "Regen") (princ) ) I tried using the vlax-put-property command; but I am not sure if there is a property name and if yes what it is. I tried some of the obvious combinations. (vlax-put-property (vlax-ename->vla-object entText) 'fontfile "Romans.shx") I also tried the vla-put-textfont command. (vla-put-textfont (vlax-ename->vla-object entText) "Romans.shx") 1) Is what I am trying to do, even possible? 2) General Question with vlax-put-property: Can you simply relate the "property" part of vlax-put-property command to the label on the property palette? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.