CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

XRefDemandLoad Property (ActiveX)

2023-1-3 00:55| 发布者: admin| 查看: 203| 评论: 0|来自: AutoCAD

摘要: 指定外部引用的需求加载。

指定外部引用的需求加载。

支持的平台:仅窗口

签名

工 务 局:

object.XRefDemandLoad
对象

类型:首选项打开保存

此属性适用的对象。

属性值

只读:

类型:枚举acXRefDemandLoad

  • acDemandLoadDisabled:关闭需求加载;将加载整个图形。
  • acDemandLoadEnabled:启用按需加载并提高 AutoCAD 性能。其他用户无法在引用文件时对其进行编辑。
  • acDemandLoadEnabledWithCopy:打开按需加载,但使用参照图形的副本。其他用户可编辑原始图形。

言论

按需加载通过仅加载再生当前图形所需的参照图形部分来提高性能。

此属性的初始值为。acDemandLoadEnabled

注意:此属性的值存储在 XLOADCTL 系统变量中。

例子

工 务 局:

Sub Example_XRefDemandLoad()
    ' This example returns the current setting of
    ' XRefDemandLoad. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currXRefDemandLoad As Integer
    Dim constant As String
    Dim newConstant As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current XRefDemandLoad value
    currXRefDemandLoad = preferences.OpenSave.XrefDemandLoad
    constant = Choose(currXRefDemandLoad + 1, "acDemandLoadDisabled", "acDemandLoadEnabled", "acDemandLoadEnabledWithCopy")
    MsgBox "The current value for XRefDemandLoad is " & constant, vbInformation, "XRefDemandLoad Example"
    
    ' Change the value for XRefDemandLoad
    newConstant = "acDemandLoadEnabledWithCopy"
    preferences.OpenSave.XrefDemandLoad = acDemandLoadEnabledWithCopy
    MsgBox "The new value for XRefDemandLoad is " & newConstant, vbInformation, "XRefDemandLoad Example"
    
    ' Reset XRefDemandLoad to its original value
    preferences.OpenSave.XrefDemandLoad = currXRefDemandLoad
    MsgBox "The XRefDemandLoad value is reset to " & constant, vbInformation, "XRefDemandLoad Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_XRefDemandLoad()
    ;; This example returns the current setting of
    ;; XRefDemandLoad. 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 XRefDemandLoad value
    (setq currXRefDemandLoad (vla-get-XrefDemandLoad (vla-get-OpenSave preferences)))
    (setq constant (cond
                       ((= currXRefDemandLoad acDemandLoadDisabled) "acDemandLoadDisabled")
                       ((= currXRefDemandLoad acDemandLoadEnabled) "acDemandLoadEnabled")
                       ((= currXRefDemandLoad acDemandLoadEnabledWithCopy) "acDemandLoadEnabledWithCopy")
                   ))
    (alert (strcat "The current value for XRefDemandLoad is " constant))
    
    ;; Change the value for XRefDemandLoad
    (setq newConstant "acDemandLoadDisabled")
    (vla-put-XrefDemandLoad (vla-get-OpenSave preferences) acDemandLoadDisabled)
    (alert (strcat "The new value for XRefDemandLoad is " newConstant))
    
    ;; Reset XRefDemandLoad to its original value
    (vla-put-XrefDemandLoad (vla-get-OpenSave preferences) currXRefDemandLoad)
    (alert (strcat "The XRefDemandLoad value is reset to " constant))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 02:27

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部