CreateBackup Property (ActiveX)

Specifies the use of a backup file.

Supported platforms: Windows only

Signature

VBA:

object.CreateBackup
object

Type: PreferencesOpenSave

The object this property applies to.

Property Value

Read-only: No

Type: Boolean

Remarks

The initial value for this property is True.

This property improves the speed of incremental saves by creating a backup file (.bak). The operating system copies the file data to create a backup file for large drawings which takes a major portion of the incremental save time.

Caution: In the case of a problem (such as a power failure in the middle of a save), it's possible that drawing data can be lost.
Note: The value of this property is stored in the ISAVEBAK system variable.

Examples

VBA:

Sub Example_CreateBackup()
    ' This example returns the current setting of
    ' CreateBackup. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currCreateBackup As Boolean
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current CreateBackup value
    currCreateBackup = preferences.OpenSave.CreateBackup
    MsgBox "The current value for CreateBackup is " & preferences.OpenSave.CreateBackup, vbInformation, "CreateBackup Example"
    
    ' Change the value for CreateBackup
    preferences.OpenSave.CreateBackup = Not (currCreateBackup)
    MsgBox "The new value for CreateBackup is " & preferences.OpenSave.CreateBackup, vbInformation, "CreateBackup Example"
    
    ' Reset CreateBackup to its original value
    preferences.OpenSave.CreateBackup = currCreateBackup
    MsgBox "The CreateBackup value is reset to " & preferences.OpenSave.CreateBackup, vbInformation, "CreateBackup Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_CreateBackup()
    ;; This example returns the current setting of
    ;; CreateBackup. 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 CreateBackup value
    (setq currCreateBackup (vla-get-CreateBackup (vla-get-OpenSave preferences)))
    (alert (strcat "The current value for CreateBackup is " (if (= currCreateBackup :vlax-true) "True" "False")))
    
    ;; Change the value for CreateBackup
    (setq newCreateBackup (if (= currCreateBackup :vlax-true) :vlax-false :vlax-true))
    (vla-put-CreateBackup (vla-get-OpenSave preferences) newCreateBackup)
    (alert (strcat "The new value for CreateBackup is " (if (= newCreateBackup :vlax-true) "True" "False")))
    
    ;; Reset CreateBackup to its original value
    (vla-put-CreateBackup (vla-get-OpenSave preferences) currCreateBackup)
    (alert (strcat "The CreateBackup value is reset to " (if (= currCreateBackup :vlax-true) "True" "False")))
)