Author Topic: Change TXT.shx to SIMPLEX.shx in all Text Styles  (Read 3223 times)

0 Members and 1 Guest are viewing this topic.

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Change TXT.shx to SIMPLEX.shx in all Text Styles
« Reply #15 on: May 29, 2021, 08:31:37 PM »
Try this on a dwg

(vlax-for ts (vla-get-textstyles  (vla-get-activedocument (vlax-get-acad-object)))
(if (= (vla-get-FontFile ts ) "Txt.shx")
(vla-put-FontFile ts "Simplex.shx")
)
)

Using a script can run this very simple lisp program, for 500 dwgs accoreconsole is the way to go you have a script that loads the lisp.
« Last Edit: May 30, 2021, 07:46:33 PM by BIGAL »
A man who never made a mistake never made anything

w64bit

  • Newt
  • Posts: 78
Re: Change TXT.shx to SIMPLEX.shx in all Text Styles
« Reply #16 on: May 30, 2021, 05:03:13 AM »
error: bad argument type: VLA-OBJECT nil
I changed s to ts in second line.
No change to any font.
You can try on the file attached.

Tharwat

  • Swamp Rat
  • Posts: 710
  • Hypersensitive
Re: Change TXT.shx to SIMPLEX.shx in all Text Styles
« Reply #17 on: May 30, 2021, 08:08:37 AM »
The same codes that posted by kpblc with the mods that indicated to in my first post.

w64bit

  • Newt
  • Posts: 78
Re: Change TXT.shx to SIMPLEX.shx in all Text Styles
« Reply #18 on: May 30, 2021, 08:22:53 AM »
I think my AutoCAD install has something wrong. On another computer it's OK.
Can you please tell me how I can add monotxt and monotxt8 in the same code?
Thank you

Tharwat

  • Swamp Rat
  • Posts: 710
  • Hypersensitive
Re: Change TXT.shx to SIMPLEX.shx in all Text Styles
« Reply #19 on: May 30, 2021, 08:41:08 AM »
Code - Auto/Visual Lisp: [Select]
  1. (defun c:Test (/ adoc fnt)
  2.   ;; kpblc - modified by Tharwat
  3.     (if (and (/= (setq fnt (vla-get-fontfile item)) "")
  4.              (wcmatch fnt "txt.shx,monotxt.shx,monotxt8.shx")
  5.              )
  6.       (vla-put-fontfile item "simplex.shx")
  7.     ) ;_ end of if
  8.   ) ;_ end of vlax-for
  9.   (vla-endundomark adoc)
  10.   (vla-regen adoc acallviewports)
  11.   (princ)
  12. ) ;_ end of defun
  13.  
  14.  

w64bit

  • Newt
  • Posts: 78
Re: Change TXT.shx to SIMPLEX.shx in all Text Styles
« Reply #20 on: May 30, 2021, 10:04:02 AM »
Thank you all very much.

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Change TXT.shx to SIMPLEX.shx in all Text Styles
« Reply #21 on: May 30, 2021, 07:47:25 PM »
Fixed the typo in the code had ts and s.
A man who never made a mistake never made anything