5 Replies Latest reply on Jan 10, 2008 11:37 PM by Anna Wood

    Changing Default Font For Drawings

    Sven Trautmann
      Could someone help me to change the default font (for a lack of a better word)?
      I want to use a particular font (Tekton Pro) for all drawings. How can I change the font to this .otf type? In system options maybe?

      Also, it actually does not appear on the font list under: Options>Document Properties>Annotations Font>Notes (and all others)

      The font is available in other applications.

      Please advise...

      S.
        • Changing Default Font For Drawings
          Drew H
          Tools/options/document properties/annotations font, then select which arena you would like to change the font in.
            • Changing Default Font For Drawings
              Sven Trautmann
              let me re-frase.

              some fonts don't show up.

              can I change the default font?

              Sven
                • Changing Default Font For Drawings
                  Anna Wood
                  I suspect then that this is a font type (.otf) that SW does not recognize. I think you may be out of luck on using that font. :-(

                  Cheers,
                    • Changing Default Font For Drawings
                      Sven Trautmann
                      but what about changing the default font? Do I have to change the font for every drawing size and every annotation? and save them as templates?

                      Sven
                        • Changing Default Font For Drawings
                          Anna Wood

                          Sven Trautmann wrote:

                           

                          but what about changing the default font? Do I have to change the font for every drawing size and every annotation? and save them as templates?



                          Sven

                          OK..... now I understand your question.

                          Yes, that is what you have to do...... :-( It is tedious. You can do it with a macro that you can run after opening each of your templates.

                          -------------------------------------------------------------
                          Option Explicit

                          Dim swApp As SldWorks.SldWorks
                          Dim swModel As SldWorks.ModelDoc2
                          Dim swDraw As SldWorks.DrawingDoc

                          Dim FontName As String
                          Dim retval As Boolean

                          Dim TextFormatObj As Object
                          Dim swTextFormat As SldWorks.TextFormat

                          Sub main()

                          Set swApp = Application.SldWorks
                          Set swModel = swApp.ActiveDoc
                          Set swDraw = swModel

                          FontName = "Century Gothic"

                          retval = ReplaceFont(swDetailingBalloonTextFormat, FontName)
                          retval = ReplaceFont(swDetailingDetailLabelTextFormat, FontName)
                          retval = ReplaceFont(swDetailingDetailTextFormat, FontName)
                          retval = ReplaceFont(swDetailingDimensionTextFormat, FontName)
                          retval = ReplaceFont(swDetailingGeneralTableTextFormat, FontName)
                          retval = ReplaceFont(swDetailingNoteTextFormat, FontName)
                          retval = ReplaceFont(swDetailingSectionLabelTextFormat, FontName)
                          retval = ReplaceFont(swDetailingSectionTextFormat, FontName)
                          retval = ReplaceFont(swDetailingSurfaceFinishTextFormat, FontName)
                          retval = ReplaceFont(swDetailingViewArrowTextFormat, FontName)
                          retval = ReplaceFont(swDetailingWeldSymbolTextFormat, FontName)

                          End Sub

                          Function ReplaceFont(AName As swUserPreferenceTextFormat_e, Fname As String)
                          Set TextFormatObj = swModel.GetUserPreferenceTextFormat(AName)
                          Set swTextFormat = TextFormatObj
                          swTextFormat.TypeFaceName = Fname
                          ReplaceFont = swModel.SetUserPreferenceTextFormat(AName, swTextFormat)
                          End Function
                          ------------------------------------------------------------------------------------

                          The above is what I have used in the past, I think this will get everything. It works for SW2007 files. Some of the more fluent VBA folks can probably tune this up for you for SW2008.


                          Cheers,