Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone,
one of our client asks us to provide drawing in pdf format with searchable text function, we haveto swap all the text style definition(except for style "Standard" and "Roadname") to use "Arial Narrow.ttf" and change the width factor to 1.
I found a code from https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-change-text-style-font-file-..., and tried to modify it. but it comes up with error message saying " error: no function definition: nil"
I couldn't figure out what i did wrong, any suggestion? Thanks.
(defun c:txt2ttf (/ DOC FNTPTH STY ) (vl-load-com) (setq doc (vla-get-activedocument (vlax-get-acad-object) ) ) (setq FntPth (findfile "C:\\Windows\\Fonts\\arialn.ttf")) (setq sty (vla-get-textstyles doc)) (vlax-for s sty (setq sname (vla-get-name s)) (if (/= sname "Standard") ( (vla-put-fontfile s FntPth) (vla-put-width s 1.0) ;; (print sname) ) ;; (print sname) ) ) (if (ssget "x" '((0 . "text"))) (vlax-for n (vla-get-activeselectionset doc) ) ) (vla-regen doc acAllViewports) (princ) )
Solved! Go to Solution.