PDA

View Full Version : Create new text style in vlisp using true type fonts?


arubus1977
2009-07-15, 10:11 AM
Hi, can anyone help.....

I am trying to create a new text style using visual lisp, the new text style is to have the arial true type font, here is the code:

(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq styleCol (vla-get-textstyles doc))
(setq myStyle (vla-add styleCol "theStyle"))
(vla-setfont myStyle "ARIAL.TTF" :vlax-False :vlax-False 0 32)

I get the error 'Automation Error. Invalid input'. The problem being the vla-setfont method, but it looks fine according to the vlisp help. I have no problem creating a new text style using an .shx font and the vla-put-fontfile method but cannot use ttf's???

Many Thanks

rkmcswain
2009-07-15, 03:39 PM
Drop the ".TTF"


(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq styleCol (vla-get-textstyles doc))
(setq myStyle (vla-add styleCol "theStyle"))
(vla-setfont myStyle "ARIAL" :vlax-False :vlax-False 0 32)

azarko
2009-07-15, 09:07 PM
Other (http://www.cadtutor.net/forum/showthread.php?t=38243) variant