ResetProfile Method (ActiveX)

Resets the value in the specified profile to its default values.

Supported platforms: Windows only

Signature

VBA:

object.ResetProfile Profile
object

Type: PreferencesProfiles

The object this method applies to.

Profile

Access: Input-only

Type: String

The profile to reset.

Return Value (RetVal)

No return value.

Remarks

The specified profile must be the current active profile. To set a profile as the current active profile, use the ActiveProfile property.

Examples

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