LogFileOn Example

Using Programming Languages other than VBA

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

	Dim preferences As AcadPreferences
	Dim currLogFileOn As Boolean

	Set preferences = ThisDrawing.Application.preferences

	' Retrieve the current LogFileOn value
	currLogFileOn = preferences.OpenSave.LogFileOn
	MsgBox "The current value for LogFileOn is " & preferences.OpenSave.LogFileOn, vbInformation, "LogFileOn Example"

	' Change the value for LogFileOn
	preferences.OpenSave.LogFileOn = Not (currLogFileOn)
	MsgBox "The new value for LogFileOn is " & preferences.OpenSave.LogFileOn, vbInformation, "LogFileOn Example"

	' Reset LogFileOn to its original value
	preferences.OpenSave.LogFileOn = currLogFileOn
	MsgBox "The LogFileOn value is reset to " & preferences.OpenSave.LogFileOn, vbInformation, "LogFileOn Example"
End Sub

 

   Comments?