自動保存間隔を分単位で指定します。
サポートされているプラットフォーム: Windows のみ
読み込み専用: いいえ
タイプ: 整数型
0 >= AutoSaveInterval <= 600
間隔をゼロにすると、自動保存が無効になります。
間隔をゼロより大きくすると、指定した間隔で図面を自動保存します。
このプロパティの初期値は 120 です。
図面を変更するのと同時にタイマがスタートします。タイマは、図面を保存するたびにリセットされ、再スタートします。AutoSavePath プロパティを使って異なる名前を指定しない限り、現在の図面は auto.sv$ に保存されます。
VBA:
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)))
)