LISP TO CHANGE ALL THE TEXTS IN THE DRAWING (AUTO) STYLE TO ARIAL NARROW.

LISP TO CHANGE ALL THE TEXTS IN THE DRAWING (AUTO) STYLE TO ARIAL NARROW.

arpansark0544TCX
Advocate Advocate
642 Views
3 Replies
Message 1 of 4

LISP TO CHANGE ALL THE TEXTS IN THE DRAWING (AUTO) STYLE TO ARIAL NARROW.

arpansark0544TCX
Advocate
Advocate

I was working on a file which has a lot of different Text styles. And I searched for a way to make all the text style to Arial Narrow.

In my research, I got this :

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-change-all-text-style-to-use...

 

But somehow it is not working out for me to convert all my Text to Arial Narrow.

 

Kindly help me out here.

 

 

 

 

0 Likes
Accepted solutions (2)
643 Views
3 Replies
Replies (3)
Message 2 of 4

EnM4st3r
Advocate
Advocate
Accepted solution

works for me.

(defun setallstylesfont	(font_file / d)
  (vlax-for style (vla-get-textstyles (setq d (vla-get-activedocument (vlax-get-acad-object))))
    (vla-put-fontfile style font_file)
  )
  (vla-regen d acactiveviewport)
)
(setallstylesfont "C:\\Windows\\Fonts\\ARIALN.TTF")
Message 3 of 4

EnM4st3r
Advocate
Advocate
Accepted solution

but just using (setallstylesfont "ARIALN.TTF") also didnt work for me, had to use complete path.
Maybe autocad does not search there, but for the shx fonts it works since they are in the Autocad path.

Message 4 of 4

arpansark0544TCX
Advocate
Advocate

this should be in same lisp file or stored/enter seperately

 

0 Likes