指定されたプロファイルの値を、その既定値にリセットします。
サポートされているプラットフォーム: Windows のみ
VBA:
object.ResetProfile Profile
タイプ: PreferencesProfiles
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: 文字列
リセットするプロファイル。
戻り値はありません。
指定されたプロファイルは、現在のアクティブ プロファイルでなければなりません。現在のアクティブ プロファイルとしてプロファイルを設定するには、ActiveProfile プロパティを使用します。
VBA:
Sub Example_ResetProfile()
' This example resets a profile to the default values.
' NOTE: A dummy profile name is used so that your existing
' profiles are not changed.
Dim preferences As AcadPreferences
Dim strProfileToReset As String
Set preferences = ThisDrawing.Application.preferences
' Specify the profile to delete.
strProfileToReset = "TestProfile"
' Delete the profile
' The call will fail if "TestProfile" does not exist
On Error GoTo Error
preferences.Profiles.ResetProfile strProfileToReset
Exit Sub
Error:
MsgBox "ResetProfile of " & strProfileToReset & " failed. " & Err.Description, , "ResetProfile Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_ResetProfile()
;; This example resets a profile to the default values.
;; NOTE: A dummy profile name is used so that your existing
;; profiles are not changed.
(setq acadObj (vlax-get-acad-object))
(setq preferences (vla-get-Preferences acadObj))
;; Specify the profile to delete.
(setq strProfileToReset "TestProfile")
;; Reset the profile
;; The call will fail if "TestProfile" does not exist
(setq err (vl-catch-all-apply 'vla-ResetProfile (list (vla-get-Profiles preferences) strProfileToReset)))
(if (= (type err) 'VL-CATCH-ALL-APPLY-ERROR)
(alert (strcat "ResetProfile of " strProfileToReset " failed. "))
(alert (strcat "We have just reset the profile " strProfileToReset))
)
)