AutoSaveInterval Property (ActiveX)

Specifies an automatic save interval in minutes.

Supported platforms: Windows only

Signature

VBA:

object.AutoSaveInterval
object

Type: PreferencesOpenSave

The object this property applies to.

Property Value

Read-only: No

Type: Integer

0 >= AutoSaveInterval <= 600

An interval equal to 0 disables automatic save.

An interval greater than 0 automatically saves the drawing at the specified intervals.

Remarks

The initial setting for this property is 120.

The timer starts as soon as you make a change to a drawing. It is reset and restarted whenever the drawing is saved. The current drawing is saved to auto.sv$ unless you have specified a different name using the AutoSavePath property.

Note: This property is also controlled by the SAVETIME system variable. The ISAVEBAK system variable (set using the CreateBackup property) improves the speed of incremental saves, especially for larger drawings. The ISAVEPERCENT system variable (set using the IncrementalSavePercent property) determines the amount of wasted space tolerated in a drawing.

Examples

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)))
)