TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lonnie on April 29, 2020, 10:41:03 AM
-
I am looking into making a set of tools to bring autocad files into revit. One of the first things is to change the text to arial. I've tried a few ways to do it but nothing seems to work. Here is the latest.
(defun c:csf (/ doc sty)
(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq sty (vla-get-textstyles doc))
(vlax-for s sty (vla-put-fontfile s "C:\\Windows\\Fonts\\arial.ttf"))
(vlax-for w sty (vla-put-width w 1.0))
(vla-regen doc acAllViewports)
(princ)
)
My problem is when I run this the fonts change to the nearest arial not to arial.ttf. Most times it's Arial CYR but I've had it change to arial.shx even.
As always thanks.
Lonnie
-
Merge text styles (or change text styles)
https://www.theswamp.org/index.php?topic=17659.0
-
I am looking into making a set of tools to bring autocad files into revit. One of the first things is to change the text to arial. I've tried a few ways to do it but nothing seems to work. Here is the latest.
(defun c:csf (/ doc sty)
(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq sty (vla-get-textstyles doc))
(vlax-for s sty (vla-put-fontfile s "C:\\Windows\\Fonts\\arial.ttf"))
(vlax-for w sty (vla-put-width w 1.0))
(vla-regen doc acAllViewports)
(princ)
)
My problem is when I run this the fonts change to the nearest arial not to arial.ttf. Most times it's Arial CYR but I've had it change to arial.shx even.
As always thanks.
Lonnie
Try this mod .. I ran into this a while back too.
;; RJP » 2020-04-29
)
)
)
)
-
Works at least in the first 4 dwg's.
Thank you.
-
Works at least in the first 4 dwg's.
Thank you.
You're welcome. :-)