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