CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

自动保存间隔属性 (ActiveX)

2023-1-3 22:17| 发布者: admin| 查看: 357| 评论: 0|来自: AutoCAD

摘要: 指定自动保存间隔(以分钟为单位)。

指定自动保存间隔(以分钟为单位)。

支持的平台:仅窗口

签名

工 务 局:

object.AutoSaveInterval
对象

类型:首选项打开保存

此属性适用的对象。

属性值

只读:

类型:整数

0 >= 自动保存间隔 <= 600

间隔等于 0 将禁用自动保存。

大于 0 的间隔会自动按指定的间隔保存图形。

言论

此属性的初始设置为 120。

当您对图形进行更改时,计时器将立即启动。每当保存图形时,它都会重置并重新启动。当前图形将保存为auto.sv$,除非您使用属性指定了其他名称。AutoSavePath

注意:此属性还由 SAVETIME 系统变量控制。ISAVEBAK 系统变量(使用属性设置)提高了增量保存的速度,尤其是对于较大的图形。ISAVE% 系统变量(使用属性设置)确定图形中容许的浪费空间量。CreateBackupIncrementalSavePercent

例子

工 务 局:

Sub Example_AutoSaveInterval()
    ' This example returns the current setting of
    ' AutoSaveInterval. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currAutoSaveInterval As Integer
    Dim newAutoSaveInterval As Integer
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current AutoSaveInterval value
    currAutoSaveInterval = preferences.OpenSave.AutoSaveInterval
    MsgBox "The current value for AutoSaveInterval is " & currAutoSaveInterval, vbInformation, "AutoSaveInterval Example"
    
    ' Change the value for AutoSaveInterval
    If currAutoSaveInterval = 0 Then
        newAutoSaveInterval = 10
    Else
        newAutoSaveInterval = 0
    End If
    preferences.OpenSave.AutoSaveInterval = newAutoSaveInterval
    MsgBox "The new value for AutoSaveInterval is " & newAutoSaveInterval, vbInformation, "AutoSaveInterval Example"
    
    ' Reset AutoSaveInterval to its original value
    preferences.OpenSave.AutoSaveInterval = currAutoSaveInterval
    MsgBox "The AutoSaveInterval value is reset to " & currAutoSaveInterval, vbInformation, "AutoSaveInterval Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_AutoSaveInterval()
    ;; This example returns the current setting of
    ;; AutoSaveInterval. 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 AutoSaveInterval value
    (setq currAutoSaveInterval (vla-get-AutoSaveInterval (vla-get-OpenSave preferences)))
    (alert (strcat "The current value for AutoSaveInterval is " (itoa currAutoSaveInterval)))
    
    ;; Change the value for AutoSaveInterval
    (if (= currAutoSaveInterval 0)
        (setq newAutoSaveInterval 10)
        (setq newAutoSaveInterval 0)
    )

    (vla-put-AutoSaveInterval (vla-get-OpenSave preferences) newAutoSaveInterval)
    (alert (strcat "The new value for AutoSaveInterval is " (itoa newAutoSaveInterval)))
    
    ;; Reset AutoSaveInterval to its original value
    (vla-put-AutoSaveInterval (vla-get-OpenSave preferences) currAutoSaveInterval)
    (alert (strcat "The AutoSaveInterval value is reset to " (itoa currAutoSaveInterval)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 02:26

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部