CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

导出配置文件方法 (ActiveX)

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

摘要: 导出活动配置文件,以便与其他用户共享。

导出活动配置文件,以便与其他用户共享。

支持的平台:仅窗口

签名

工 务 局:

object.ExportProfile Profile, RegFile
对象

类型:首选项配置文件

此方法适用的对象。

轮廓

访问:仅输入

类型:字符串

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

注册文件

访问:仅输入

类型:字符串

配置文件将导出到的文件的名称。文件的扩展名应为 .arg

返回值(RetVal)

无返回值。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_ExportProfile()
    ' This example exports the active profile to a new name.
    
    Dim preferences As AcadPreferences
    Dim currActiveProfile As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current ActiveProfile value
    currActiveProfile = preferences.Profiles.ActiveProfile
    MsgBox "The current ActiveProfile is: " & preferences.Profiles.ActiveProfile, , "ExportProfile Example"
    
    ' Export the active profile
    preferences.Profiles.ExportProfile currActiveProfile, "TestProfile.arg"
    MsgBox "The ActiveProfile has been exported to: TestProfile.arg", , "ExportProfile Example"
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ExportProfile()
    ;; This example exports the active profile to a new name.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
  
    ;; Retrieve the current ActiveProfile value
    (setq currActiveProfile (vla-get-ActiveProfile (vla-get-Profiles preferences)))
    (alert (strcat "The current ActiveProfile is: " currActiveProfile))
    
    ;; Export the active profile
    (vla-ExportProfile (vla-get-Profiles preferences) currActiveProfile "c:\\Temp\\TestProfile.arg")
    (alert "The ActiveProfile has been exported to: TestProfile.arg")
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 03:40

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部