CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2023 开发者帮助

GetAllProfileNames 方法 (ActiveX)

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

GetAllProfileNames 方法 (ActiveX)

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

支持的平台:仅限 Windows

签名

VBA:

object.GetAllProfileNames pNames
对象

类型:PreferencesProfiles

此方法应用到的对象。

p名称

访问:仅输出

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

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

返回值 (RetVal)

无返回值。

言论

没有其他评论。

例子

VBA:

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

可视化 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   苏公网安备32011402011833)

GMT+8, 2025-3-14 06:54

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部