CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2025 开发者帮助

TempXRefPath 属性 (ActiveX)

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

TempXRefPath 属性 (ActiveX)

指定外部引用文件的位置。

支持的平台:仅限 Windows

签名

VBA:

object.TempXRefPath
对象

类型:PreferencesFiles

此属性应用于的对象。

属性值

只读:

类型:字符串

用于搜索外部引用文件的目录的驱动器和路径。

言论

如果在属性上选择需求加载,则此位置将用于外部参照的副本。acEnableWithCopyXRefDemandLoad

例子

VBA:

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

可视化 LISP:

(vl-load-com)
(defun c:Example_TempXRefPath()
    ;; This example returns the current setting of
    ;; TempXRefPath. 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 TempXRefPath value
    (setq currTempXRefPath (vla-get-TempXrefPath (vla-get-Files preferences)))
    (alert (strcat "The current value for TempXRefPath is " currTempXRefPath))
    
    ;; Change the value for TempXRefPath
    (setq newTempXRefPath "TestTempXRefPath")
    (vla-put-TempXrefPath (vla-get-Files preferences) newTempXRefPath)
    (alert (strcat "The new value for TempXRefPath is " newTempXRefPath))
    
    ;; Reset TempXRefPath to its original value
    (vla-put-TempXrefPath (vla-get-Files preferences) currTempXRefPath)
    (alert (strcat "The TempXRefPath value is reset to " currTempXRefPath))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-1-19 06:41

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部