BeepOnError プロパティ(ActiveX)

無効なエントリが検出されたとき、警告音を鳴らすかどうかを指定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.BeepOnError
object

タイプ: PreferencesSystem

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: いいえ

タイプ: ブール型

注意

このプロパティの初期値は False です。

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