CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

PlotLegacy Property (ActiveX)

2023-1-3 08:42| 发布者: admin| 查看: 769| 评论: 0|来自: AutoCAD

摘要: 切换是否允许运行旧版绘图脚本。

切换是否允许运行旧版绘图脚本。

支持的平台:仅窗口

签名

工 务 局:

object.PlotLegacy
对象

类型:首选项输出

此属性适用的对象。

属性值

只读:

类型:布尔

  • True:允许运行旧版打印脚本。
  • False:不允许运行旧版打印脚本。

言论

此属性的初始值为。False

例子

工 务 局:

Sub Example_PlotLegacy()
    ' This example reads and modifies the PlotLegacy
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.
    
    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Boolean
    
    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.Preferences.Output
    
    ' Read and display the original value
    originalValue = ACADPref.PlotLegacy
    MsgBox "The PlotLegacy preference is set to: " & originalValue

    ' Modify the PlotLegacy preference by toggling the value
    ACADPref.PlotLegacy = Not ACADPref.PlotLegacy

    MsgBox "The PlotLegacy preference has been set to: " & ACADPref.PlotLegacy

    ' Reset the preference back to its original value
    ACADPref.PlotLegacy = originalValue
    MsgBox "The PlotLegacy preference was reset back to: " & originalValue
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_PlotLegacy()
    ;; This example reads and modifies the PlotLegacy
    ;; preference value.
    ;; When finished, this example resets the preference value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-PlotLegacy (vla-get-Output preferences)))
    (alert (strcat "The PlotLegacy preference is set to: " (if (= originalValue :vlax-true) "True" "False")))

    ;; Modify the PlotLegacy preference by toggling the value
    (vla-put-PlotLegacy (vla-get-Output preferences) (if (= originalValue :vlax-true) :vlax-false :vlax-true))
    (setq newValue (vla-get-PlotLegacy (vla-get-Output preferences)))
    (alert (strcat "The PlotLegacy preference has been set to: " (if (= newValue :vlax-true) "True" "False")))

    ;; Reset the preference back to its original value
    (vla-put-PlotLegacy (vla-get-Output preferences) originalValue)
    (alert (strcat "The PlotLegacy preference was reset back to: " (if (= originalValue :vlax-true) "True" "False")))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 09:23

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部