LoadAcadLspInAllDocuments プロパティ(ActiveX)

acad.lsp を起動時にロードするか、各図面と一緒にロードするかを指定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.LoadAcadLspInAllDocuments
object

タイプ: PreferencesSystem

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: いいえ

タイプ: ブール型

注意

このプロパティの初期値は True です。

注: このプロパティの値は、システム変数 ACADLSPASDOC に格納されます。

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