CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

支持路径属性 (ActiveX)

2023-1-3 05:13| 发布者: admin| 查看: 689| 评论: 0|来自: AutoCAD

摘要: 指定 AutoCAD 在其中搜索支持文件的目录。

指定 AutoCAD 在其中搜索支持文件的目录。

支持的平台:仅窗口

签名

工 务 局:

object.SupportPath
对象

类型:首选项文件

此属性适用的对象。

属性值

只读:

类型:字符串

支持文件所在的目录。指定支持、字体、帮助和奖励文件的驱动器号和路径。

言论

使用分号 (;)分隔多个目录;但是,不要以分号结尾字符串。

例子

工 务 局:

Sub Example_SupportPath()
    ' This example returns the current setting of
    ' SupportPath. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currSupportPath As String
    Dim newSupportPath As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current SupportPath value
    currSupportPath = preferences.Files.SupportPath
    MsgBox "The current value for SupportPath is " & currSupportPath, vbInformation, "SupportPath Example"
    
    ' Change the value for SupportPath
    newSupportPath = "TestSupportPath"
    preferences.Files.SupportPath = newSupportPath
    MsgBox "The new value for SupportPath is " & newSupportPath, vbInformation, "SupportPath Example"
    
    ' Reset SupportPath to its original value
    preferences.Files.SupportPath = currSupportPath
    MsgBox "The SupportPath value is reset to " & currSupportPath, vbInformation, "SupportPath Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_SupportPath()
    ;; This example returns the current setting of
    ;; SupportPath. It then changes the value, and finally
    ;; it resets the value back to the original setting.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Retrieve the current SupportPath value
    (setq currSupportPath (vla-get-SupportPath (vla-get-Files preferences)))
    (alert (strcat "The current value for SupportPath is " currSupportPath))
    
    ;; Change the value for SupportPath
    (setq newSupportPath "TestSupportPath")
    (vla-put-SupportPath (vla-get-Files preferences) newSupportPath)
    (alert (strcat "The new value for SupportPath is " newSupportPath))
    
    ;; Reset SupportPath to its original value
    (vla-put-SupportPath (vla-get-Files preferences) currSupportPath)
    (alert (strcat "The SupportPath value is reset to " currSupportPath))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 13:15

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部