XRefDemandLoad Property (ActiveX)

Specifies demand loading of external references.

Supported platforms: Windows only

Signature

VBA:

object.XRefDemandLoad
object

Type: PreferencesOpenSave

The object this property applies to.

Property Value

Read-only: No

Type: acXRefDemandLoad enum

Remarks

Demand loading improves performance by loading only the parts of the referenced drawing needed to regenerate the current drawing.

The initial value for this property is acDemandLoadEnabled.

Note: The value for this property is stored in the XLOADCTL system variable.

Examples

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

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))
)