TextFont Example

Using Programming Languages other than VBA

Sub Example_TextFont()
	' This example returns the current setting of
	' TextFont. It then changes the value, and finally
	' it resets the value back to the original setting.

	Dim preferences As AcadPreferences
	Dim currTextFont As String

	Set preferences = ThisDrawing.Application.preferences

	' Retrieve the current TextFont value
	currTextFont = preferences.DISPLAY.TextFont
	MsgBox "The current value for TextFont is " & preferences.DISPLAY.TextFont, vbInformation, "TextFont Example"

	' Change the value for TextFont
	preferences.DISPLAY.TextFont = "TestTextFont"
	MsgBox "The new value for TextFont is " & preferences.DISPLAY.TextFont, vbInformation, "TextFont Example"

	' Reset TextFont to its original value
	preferences.DISPLAY.TextFont = currTextFont
	MsgBox "The TextFont value is reset to " & preferences.DISPLAY.TextFont, vbInformation, "TextFont Example"
End Sub

 

   Comments?