将指定配置文件中的值重置为其默认值。 支持的平台:仅窗口 返回值(RetVal)无返回值。 言论指定的配置文件必须是当前活动配置文件。若要将配置文件设置为当前活动配置文件,请使用属性。ActiveProfile 例子工 务 局: 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)) ) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:47
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.