LogFileOn Property (ActiveX)

Specifies whether the contents of the text window are written to a log file.

Supported platforms: Windows only

Signature

VBA:

object.LogFileOn
object

Type: PreferencesOpenSave

The object this property applies to.

Property Value

Read-only: No

Type: Boolean

Remarks

The initial value of this property is True.

The log file records the contents of the text window in a text file. Use the LogFilePath property to specify the name of the log file.

Note: The value for this property is stored in the LOGFILEMODE system variable.

Examples

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

Visual LISP:

(vl-load-com)
(defun c: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.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))

    ;; Retrieve the current LogFileOn value
    (setq currLogFileOn (vla-get-LogFileOn (vla-get-OpenSave preferences)))
    (alert (strcat "The current value for LogFileOn is " (if (= currLogFileOn :vlax-true) "True" "False")))
    
    ;; Change the value for LogFileOn
    (vla-put-LogFileOn (vla-get-OpenSave preferences) (if (= currLogFileOn :vlax-true) :vlax-false :vlax-true))
    (alert (strcat "The new value for LogFileOn is " (if (= (vla-get-LogFileOn (vla-get-OpenSave preferences)) :vlax-true) "True" "False")))
    
    ;; Reset LogFileOn to its original value
    (vla-put-LogFileOn (vla-get-OpenSave preferences) currLogFileOn)
    (alert (strcat "The LogFileOn value is reset to " (if (= (vla-get-LogFileOn (vla-get-OpenSave preferences)) :vlax-true) "True" "False")))
)