CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2020 开发者帮助

LoadAcadLspInAllDocuments 属性 (ActiveX)

2024-5-18 18:22| 发布者: admin| 查看: 97| 评论: 0|原作者: admin|来自: AutoCAD

LoadAcadLspInAllDocuments 属性 (ActiveX)

指定 acad.lsp 是在启动时加载还是在每个图形中加载。

支持的平台:仅限 Windows

签名

VBA:

object.LoadAcadLspInAllDocuments
对象

类型:PreferencesSystem

此属性应用于的对象。

属性值

只读:

类型:布尔

  • Trueacad.lsp 随每个图形一起加载。
  • Falseacad.lsp 仅在启动时与第一张图形一起加载。

言论

此属性的初始值为 。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

可视化 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")))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-1-19 06:41

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部