LoadAcadLspInAllDocuments Property (ActiveX)

Specifies whether acad.lsp is loaded at startup or with each drawing.

Supported platforms: Windows only

Signature

VBA:

object.LoadAcadLspInAllDocuments
object

Type: PreferencesSystem

The object this property applies to.

Property Value

Read-only: No

Type: Boolean

Remarks

The initial value for this property is True.

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

Examples

VBA:

Sub Example_LoadAcadLspInAllDocuments()
    ' This example returns the current setting of
    ' LoadAcadLspInAllDocuments. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currLoadAcadLspInAllDocuments As Boolean
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current LoadAcadLspInAllDocuments value
    currLoadAcadLspInAllDocuments = preferences.System.LoadAcadLspInAllDocuments
    MsgBox "The current value for LoadAcadLspInAllDocuments is " & preferences.System.LoadAcadLspInAllDocuments, vbInformation, "LoadAcadLspInAllDocuments Example"
    
    ' Change the value for LoadAcadLspInAllDocuments
    preferences.System.LoadAcadLspInAllDocuments = Not (currLoadAcadLspInAllDocuments)
    MsgBox "The new value for LoadAcadLspInAllDocuments is " & preferences.System.LoadAcadLspInAllDocuments, vbInformation, "LoadAcadLspInAllDocuments Example"
    
    ' Reset LoadAcadLspInAllDocuments to its original value
    preferences.System.LoadAcadLspInAllDocuments = currLoadAcadLspInAllDocuments
    MsgBox "The LoadAcadLspInAllDocuments value is reset to " & preferences.System.LoadAcadLspInAllDocuments, vbInformation, "LoadAcadLspInAllDocuments Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LoadAcadLspInAllDocuments()
    ;; This example returns the current setting of
    ;; LoadAcadLspInAllDocuments. 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 LoadAcadLspInAllDocuments value
    (setq currLoadAcadLspInAllDocuments (vla-get-LoadAcadLspInAllDocuments (vla-get-System preferences)))
    (alert (strcat "The current value for LoadAcadLspInAllDocuments is " (if (= currLoadAcadLspInAllDocuments :vlax-true) "True" "False")))
    
    ;; Change the value for LoadAcadLspInAllDocuments
    (vla-put-LoadAcadLspInAllDocuments (vla-get-System preferences) (if (= currLoadAcadLspInAllDocuments :vlax-true) :vlax-false :vlax-true))
    (alert (strcat "The new value for LoadAcadLspInAllDocuments is " (if (= (vla-get-LoadAcadLspInAllDocuments (vla-get-System preferences)) :vlax-true) "True" "False")))
    
    ;; Reset LoadAcadLspInAllDocuments to its original value
    (vla-put-LoadAcadLspInAllDocuments (vla-get-System preferences) currLoadAcadLspInAllDocuments)
    (alert (strcat "The LoadAcadLspInAllDocuments value is reset to " (if (= (vla-get-LoadAcadLspInAllDocuments (vla-get-System preferences)) :vlax-true) "True" "False")))
)