CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

显示打印样式属性 (ActiveX)

2023-1-3 06:17| 发布者: admin| 查看: 309| 评论: 0|来自: AutoCAD

摘要: 指定是否在图形中显示打印样式和打印样式名称。

指定是否在图形中显示打印样式和打印样式名称。

支持的平台:仅窗口

签名

工 务 局:

object.ShowPlotStyles
对象

类型:布局绘图配置

此属性适用的对象。

属性值

只读:

类型:布尔

  • True:显示和打印打印样式和打印样式名称。
  • False:不显示打印样式和打印样式名称。

言论

该属性等效于 AutoCAD 中的“显示打印样式”选项。ShowPlotStyles

例子

工 务 局:

Sub Example_ShowPlotStyles()
    ' This example reads and modifies the ShowPlotStyles
    ' value, and then regenerates all viewports.
    
    Dim ACADLayout As ACADLayout
    Dim originalValue As Boolean
    
    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout
    
    ' Read and display the original value
    originalValue = ACADLayout.ShowPlotStyles
    MsgBox "The ShowPlotStyles value is set to: " & originalValue

    ' Modify the ShowPlotStyles preference by changing the value
    ACADLayout.ShowPlotStyles = Not ACADLayout.ShowPlotStyles
    MsgBox "The ShowPlotStyles value has been set to: " & ACADLayout.ShowPlotStyles

    ' Regenerate viewports
    ThisDrawing.Regen acAllViewports

End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ShowPlotStyles()
    ;; This example reads and modifies the ShowPlotStyles
    ;; value, and then regenerates all viewports.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Get the layout object
    (setq ACADLayout (vla-get-ActiveLayout doc))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-ShowPlotStyles ACADLayout))
    (alert (strcat "The ShowPlotStyles value is set to: " (if (= originalValue :vlax-true) "True" "False")))

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

    ;; Regenerate viewports
    (vla-Regen doc acAllViewports)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-27 09:45

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部