LogFileOn 属性 (ActiveX) 
指定是否将文本窗口的内容写入日志文件。 支持的平台:仅限 Windows 属性值只读:不 类型:布尔 
 言论此属性的初始值为 。True 日志文件将文本窗口的内容记录在文本文件中。使用该属性指定日志文件的名称。LogFilePath 注意:此属性的值存储在 LOGFILEMODE 系统变量中。 
例子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
可视化 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")))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 14:28
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.