XRefDemandLoad 属性 (ActiveX) 
指定外部参照的按需加载。 支持的平台:仅限 Windows 属性值只读:不 类型:枚举acXRefDemandLoad 
 言论按需加载通过仅加载重新生成当前图形所需的参照图形的零件来提高性能。 此属性的初始值为 。acDemandLoadEnabled 注意:此属性的值存储在 XLOADCTL 系统变量中。 
例子VBA: 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
可视化 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))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 19:41
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.