| GetAllProfileNames 方法 (ActiveX) 获取系统的所有可用配置文件。 支持的平台:仅限 Windows 签名VBA: object.GetAllProfileNames pNames 
 返回值 (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)
) | 
 |Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-10-31 14:20
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.