CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

DeleteProfile 方法 (ActiveX)

2024-5-18 19:07| 发布者: admin| 查看: 158| 评论: 0|原作者: admin|来自: AutoCAD

DeleteProfile 方法 (ActiveX)

删除指定的配置文件。

支持的平台:仅限 AutoCAD for Windows;AutoCAD LT for Windows 不支持

签名

VBA:

object.DeleteProfile ProfileName
对象

类型:PreferencesProfiles

此方法应用到的对象。

配置文件名称

访问:仅输入

类型:字符串

要删除的配置文件的名称。

返回值 (RetVal)

无返回值。

言论

没有其他评论。

例子

VBA:

Sub Example_DeleteProfile()
    ' This example deletes a profile.
    
    Dim preferences As AcadPreferences
    Dim strProfileToDelete As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Specify the profile to delete.
    strProfileToDelete = "TestProfile"
    
    ' Delete the profile
    ' The call will fail if "TestProfile" does not exist or
    ' if "TestProfile" is the current profile.
    On Error GoTo Error
    preferences.Profiles.DeleteProfile strProfileToDelete
    Exit Sub

Error:
    MsgBox "DeleteProfile of " & strProfileToDelete & " failed. " & Err.Description, , "DeleteProfile Example"
        
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_DeleteProfile()
    ;; This example deletes a profile.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Specify the profile to delete.
    (setq strProfileToDelete "TestProfile")
    (vla-CopyProfile (vla-get-Profiles preferences) "<<Unnamed Profile>>" strProfileToDelete)

    (alert (strcat "Profile " strProfileToDelete " created from <<Unnamed Profile>>."))
    
    ;; Delete the profile
    ;; The call will fail if "TestProfile" does not exist or
    ;; if "TestProfile" is the current profile.
    (vla-DeleteProfile (vla-get-Profiles preferences) strProfileToDelete)
    (alert (strcat "Profile " strProfileToDelete " deleted."))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1   苏公网安备32011402011833)

GMT+8, 2025-3-5 17:52

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部