Author Topic: Change font type  (Read 4179 times)

0 Members and 1 Guest are viewing this topic.

Luke

  • Guest
Change font type
« on: September 02, 2009, 04:34:26 PM »
I currently have a text style called LCC.  It is used all over the place... my standard notes, in my dimension styles and within my title block.

The font type is Romans.  I need to change it to Ariel.  Changing my template so a new drawing is correct is no problem.  But all my old drawings need to be changed. 

Is this a job for a script / lisp or do I need to font map something?  I do not want the romans font totaly replaced by Ariel, I just want to change the fone used in my text style.

Thanks

curmudgeon

  • Newt
  • Posts: 194
Re: Change font type
« Reply #1 on: September 02, 2009, 05:18:02 PM »
I work in autocad 2000 but, if ALL your text is extremely similar, justifications etc., you can use SSX from express tools to create a selection set of the text you want to change, create or insert one piece of text with your new font and MATCHPROP previous.

if they don't call it SSX anymore:

Code: [Select]
(setq ss1 (ssget "X" '((7 . "LCC"))))
should get a similar selection set.
then create the similar style with ariel font type and name it something different, like LCC1.
then modify the text entities with SUBST and ENTMOD.

but the lisp might look like this:

Code: [Select]
(defun c:foo ( / ss1 count)
  (setq ss1   (ssget "X" '((7 . "LLC")))
count 0
  )
  (repeat (sslength ss1)
    (entmod
      (subst '(7 . "LLC1")
     (assoc 7 (setq ent (entget (ssname ss1 count))))
     ent
      )
    )
    (setq count (+ count 1))
  )
)

of course, if you have text in a block, like your title block, the lisp gets more complex, or you can explode your blocks with text in them, foo them, and redefine the block(s).

hope this helps.

roy



Never express yourself more clearly than you are able to think.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Change font type
« Reply #2 on: September 02, 2009, 10:41:05 PM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Change font type
« Reply #3 on: September 02, 2009, 11:12:56 PM »
if all you need to do is change the font for the specific text style, this will work:
Code: [Select]
(vl-catch-all-apply
  '(lambda ()
     (vla-put-fontfile
       (vla-item
         (vla-get-textstyles
           (vla-get-activedocument
             (vlax-get-acad-object)
           ) ;_ vla-get-activedocument
         ) ;_ vla-get-textstyles
         "LCC"
       ) ;_ vla-item
       "Arial.ttf"
     ) ;_ vla-put-fontfile
   ) ;_ lambda
) ;_ vl-catch-all-apply
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Joe Burke

  • Guest
Re: Change font type
« Reply #4 on: September 03, 2009, 06:51:33 AM »
Also keep in mind, if mtext contains embedded font formatting, changing the text style will not change the appearance of the text. You would have to remove the embedded format codes from the text string.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Change font type
« Reply #5 on: September 03, 2009, 09:01:07 AM »
Also keep in mind, if mtext contains embedded font formatting, changing the text style will not change the appearance of the text. You would have to remove the embedded format codes from the text string.
tag, you're it.
« Last Edit: September 04, 2009, 09:19:52 AM by alanjt »
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Joe Burke

  • Guest
Re: Change font type
« Reply #6 on: September 04, 2009, 08:24:38 AM »
Okay,

Attached is my current beta version of StripFormat.

Example: strip only embedded font formatting from an mtext string:

(StripFormat <string> (list "F"))

BTW, "your" is a possessive pronoun. The correct syntax is "you're". A contraction of "you are".
« Last Edit: September 04, 2009, 09:16:44 AM by Joe Burke »

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Change font type
« Reply #7 on: September 04, 2009, 09:39:05 AM »
Okay,

Attached is my current beta version of StripFormat.

Example: strip only embedded font formatting from an mtext string:

(StripFormat <string> (list "F"))

BTW, "your" is a possessive pronoun. The correct syntax is "you're". A contraction of "you are".
you're absolutely correct. fast typing and not thinking about what i was saying, but is that really relevant?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Joe Burke

  • Guest
Re: Change font type
« Reply #8 on: September 04, 2009, 09:58:04 AM »
Okay,

Attached is my current beta version of StripFormat.

Example: strip only embedded font formatting from an mtext string:

(StripFormat <string> (list "F"))

BTW, "your" is a possessive pronoun. The correct syntax is "you're". A contraction of "you are".
you're absolutely correct. fast typing and not thinking about what i was saying, but is that really relevant?

From my viewpoint, it's relevant if you want me to pay attention to your comments. Bad English tends to be ignored.

Let's try to refocus on the issues at hand.
« Last Edit: September 04, 2009, 10:15:48 AM by Joe Burke »

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Change font type
« Reply #9 on: September 04, 2009, 10:53:15 AM »
Okay,

Attached is my current beta version of StripFormat.

Example: strip only embedded font formatting from an mtext string:

(StripFormat <string> (list "F"))

BTW, "your" is a possessive pronoun. The correct syntax is "you're". A contraction of "you are".
you're absolutely correct. fast typing and not thinking about what i was saying, but is that really relevant?

From my viewpoint, it's relevant if you want me to pay attention to your comments. Bad English tends to be ignored.

Let's try to refocus on the issues at hand.
my sentiments exactly.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Change font type
« Reply #10 on: September 04, 2009, 11:05:40 AM »
If you set it up correctly, then you can use the code here ( link below ) to run through drawings without opening them in the editor.

[ http://www.theswamp.org/index.php?topic=29933.0 ]
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Change font type
« Reply #11 on: September 04, 2009, 11:23:05 AM »
If you set it up correctly, then you can use the code here ( link below ) to run through drawings without opening them in the editor.

[ http://www.theswamp.org/index.php?topic=29933.0 ]
great idea Tim.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox