CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

PlotType 属性 (ActiveX)

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

PlotType 属性 (ActiveX)

指定布局或打印配置的类型。

支持的平台:仅限 Windows

签名

VBA:

object.PlotType
对象

类型:布局PlotConfiguration

此属性应用于的对象。

属性值

只读:

类型:枚举acPlotType

  • acDisplay:打印当前显示器中的所有内容。
  • acExtents:打印当前所选空间范围内的所有内容。
  • acLimits:打印当前空间限制内的所有内容。
  • acView:打印由属性命名的视图。ViewToPlot
  • acWindow:打印方法指定的窗口中的所有内容。SetWindowToPlot
  • acLayout:打印指定纸张尺寸边距内的所有内容,原点从“布局”选项卡中的 0,0 坐标位置计算。从模型空间打印时,此选项不可用。

言论

在重新生成图形之前,对此属性的更改将不可见。使用该方法重新生成图形。Regen

必须先调用该属性或方法,然后才能将 设置为 或 。ViewToPlotSetWindowToPlotPlotTypeacViewacWindow

例子

VBA:

Sub Example_PlotType()
    ' This example reads and modifies the PlotType
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.
    
    Dim ACADLayout As ACADLayout
    Dim originalValue As Integer
    
    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout
    
    ' Read and display the original value
    originalValue = ACADLayout.PlotType
    MsgBox "The PlotType value is set to: " & originalValue

    ' Modify the PlotType preference by toggling the value
    ACADLayout.PlotType = acExtents
    MsgBox "The PlotType preference has been set to: " & ACADLayout.PlotType

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

可视化 LISP:

(vl-load-com)
(defun c:Example_PlotType()
    ;; This example reads and modifies the PlotType
    ;; Layout value.
    ;; When finished, this example resets the  value back to
    ;; its original value.
    (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-PlotType ACADLayout))
    (alert (strcat "The PlotType value is set to: " (itoa originalValue)))

    ;; Modify the PlotType preference by toggling the value
    (vla-put-PlotType ACADLayout acExtents)
    (alert (strcat "The PlotType preference has been set to: " (itoa (vla-get-PlotType ACADLayout))))

    ;; Reset the preference back to its original value
    (vla-put-PlotType ACADLayout originalValue)
    (alert (strcat "The PlotType preference was reset back to: " (itoa originalValue)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-3-14 07:31

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部