CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

LogFileOn Property (ActiveX)

2023-1-3 11:37| 发布者: admin| 查看: 481| 评论: 0|来自: AutoCAD

摘要: 指定是否将文本窗口的内容写入日志文件。

指定是否将文本窗口的内容写入日志文件。

支持的平台:仅窗口

签名

工 务 局:

object.LogFileOn
对象

类型:首选项打开保存

此属性适用的对象。

属性值

只读:

类型:布尔

  • True:日志文件已打开。
  • False:日志文件已关闭。

言论

此属性的初始值为。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")))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 05:54

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部