CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

GetAllProfileNames Method (ActiveX)

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

摘要: 获取系统的所有可用配置文件。

获取系统的所有可用配置文件。

支持的平台:仅窗口

签名

工 务 局:

object.GetAllProfileNames pNames
对象

类型:首选项配置文件

此方法适用的对象。

p名称

访问:仅输出

类型:变体(字符串数组)

系统的可用配置文件名称数组。

返回值(RetVal)

无返回值。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_GetAllProfileNames()
    ' This example gets all the profiles available for the system.
    
    Dim systemProfiles As Variant
    AcadApplication.Preferences.Profiles.GetAllProfileNames systemProfiles
       
    ' List all the profiles for the system
    Dim x As Integer
    Dim msg As String
    msg = ""
    For x = LBound(systemProfiles) To UBound(systemProfiles)
        msg = msg & systemProfiles(x) & vbCrLf
    Next
    MsgBox msg, vbInformation, "Available Profiles"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_GetAllProfileNames()
    ;; This example gets all the profiles available for the system.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
  
    ;; Use the PreferencesProfiles object
    (setq systemProfiles "")
    (vla-GetAllProfileNames (vla-get-Profiles preferences) 'systemProfiles)
       
    ;; List all the profiles for the system
    (setq x 0
          msg "")
    (while (>= (vlax-safearray-get-u-bound systemProfiles 1) x)
        (setq msg (strcat msg (vlax-safearray-get-element systemProfiles x) "\n"))
        (setq x (1+ x))
    )
    (alert msg)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 07:25

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部