Specifies the use of a backup file.
Supported platforms: Windows only
VBA:
object.CreateBackup
Type: PreferencesOpenSave
The object this property applies to.
Read-only: No
Type: Boolean
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.
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"))) )