CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

导入配置文件方法 (ActiveX)

2023-1-4 06:10| 发布者: admin| 查看: 619| 评论: 0|来自: AutoCAD

摘要: 导入其他用户创建的配置文件。

导入其他用户创建的配置文件。

支持的平台:仅窗口

签名

工 务 局:

object.ImportProfile Profile, RegFile, IncludePathInfo
对象

类型:首选项配置文件

此方法适用的对象。

轮廓

访问:仅输入

类型:字符串

要导入的配置文件的名称。

注册文件

访问:仅输入

类型:字符串

应从中导入配置文件的注册表文件。该文件应具有 .arg扩展名。

包含路径信息

访问:仅输入

类型:布尔

  • True:将保留注册表文件中的路径信息。
  • False:不会保留注册表文件中的路径信息。

返回值(RetVal)

无返回值。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_ImportProfile()
    ' This example imports a profile.
    ' NOTE: A dummy profile name is used so that your existing
    ' profiles are not changed.
    
    Dim preferences As AcadPreferences
    Dim strProfileToImport As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Specify the profile to delete.
    strProfileToImport = "TestProfile"
    
    ' Delete the profile
    ' The call will fail if "TestProfile" does not exist
    On Error GoTo Error
    preferences.Profiles.ImportProfile strProfileToImport, "TESTPROFILE.ARG", True
    
    Exit Sub
    
Error:
    MsgBox "ImportProfile of " & strProfileToImport & " failed. " & Err.Description, , "ImportProfile Example"
        
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ImportProfile()
    ;; This example imports a profile.
    ;; 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 import.
    (setq strProfileToImport "TestProfile")
    (vla-ImportProfile (vla-get-Profiles preferences) strProfileToImport (findfile "TESTPROFILE.ARG") :vlax-true)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 14:00

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部