CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

使用上一个打印设置属性 (ActiveX)

2023-1-3 01:58| 发布者: admin| 查看: 228| 评论: 0|来自: AutoCAD

摘要: 应用上一个成功打印的打印设置。

应用上一个成功打印的打印设置。

支持的平台:仅窗口

签名

工 务 局:

object.UseLastPlotSettings
对象

类型:首选项输出

此属性适用的对象。

属性值

只读:

类型:布尔

  • True:使用上次成功打印的设置作为当前打印设置。
  • False:不要将上次成功绘图的设置用作当前绘图设置。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_UseLastPlotSettings()
    ' This example reads and modifies the UseLastPlotSettings
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' it's 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.UseLastPlotSettings
    MsgBox "The UseLastPlotSettings preference is set to: " & originalValue

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

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

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

Visual LISP:

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

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

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

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 19:45

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部