Specifies the location of the font file to use if AutoCAD cannot locate the original font and an alternate font is not specified in the font mapping file.
Supported platforms: Windows only
VBA:
object.AltFontFile
Type: PreferencesFiles
The object this property applies to.
Read-only: No
Type: String
The alternate font file.
No additional remarks.
VBA:
Sub Example_AltFontFile()
' This example returns the current setting of
' AltFontFile. It then changes the value, and finally
' it resets the value back to the original setting.
Dim preferences As AcadPreferences
Dim currAltFontFile As String
Dim newAltFontFile As String
Set preferences = ThisDrawing.Application.preferences
' Retrieve the current AltFontFile value
currAltFontFile = preferences.Files.AltFontFile
MsgBox "The current value for AltFontFile is " & currAltFontFile, vbInformation, "AltFontFile Example"
' Change the value for AltFontFile
newAltFontFile = "C:/AutoCAD/Fonts/gothice.shx"
preferences.Files.AltFontFile = newAltFontFile
MsgBox "The new value for AltFontFile is " & newAltFontFile, vbInformation, "AltFontFile Example"
' Reset AltFontFile to its original value
preferences.Files.AltFontFile = currAltFontFile
MsgBox "The AltFontFile value is reset to " & currAltFontFile, vbInformation, "AltFontFile Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_AltFontFile()
;; This example returns the current setting of
;; AltFontFile. It then changes the value, and finally
;; it resets the value back to the original setting.
(setq acadObj (vlax-get-acad-object))
(setq preferences (vla-get-Preferences acadObj))
(setq files (vla-get-Files preferences))
;; Retrieve the current AltFontFile value
(setq currAltFontFile (vla-get-AltFontFile files))
(alert (strcat "The current value for AltFontFile is " currAltFontFile))
;; Change the value for AltFontFile
(setq newAltFontFile "C:/AutoCAD/Fonts/gothice.shx")
(vla-put-AltFontFile files newAltFontFile)
(alert (strcat "The new value for AltFontFile is " newAltFontFile))
;; Reset AltFontFile to its original value
(vla-put-AltFontFile files currAltFontFile)
(alert (strcat "The AltFontFile value is reset to " currAltFontFile))
)