BeepOnError Property (ActiveX)

Specifies if AutoCAD should sound an alarm beep when it detects an invalid entry.

Supported platforms: Windows only

Signature

VBA:

object.BeepOnError
object

Type: PreferencesSystem

The object this property applies to.

Property Value

Read-only: No

Type: Boolean

Remarks

The initial value for this property is False.

Examples

VBA:

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

Visual LISP:

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