CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

PlotPolicy Property (ActiveX)

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

摘要: 确定创建新图形时对象的颜色特性是否与其打印样式名称相关联。

确定创建新图形时对象的颜色特性是否与其打印样式名称相关联。

支持的平台:仅窗口

签名

工 务 局:

object.PlotPolicy
对象

类型:首选项输出

此属性适用的对象。

属性值

只读:

类型:枚举acPlotPolicy

  • acPolicyLegacy:在新图形和在早期版本的 AutoCAD 中创建的图形中指定与颜色相关的打印样式。与颜色相关的打印样式使用 AutoCAD 颜色索引中的数字来创建文件扩展名为 .ctb的打印样式表。每种颜色都由一个名称或数字定义,范围从 1 到 255。可以将每个颜色编号指定给笔绘图仪上的不同笔,以便在打印图形中实现不同的特性设置。如果输入此选项,则会为每个颜色设置创建一个打印样式。
  • acPolicyNamed:指定新图形和在早期版本的 AutoCAD 中创建的图形中的命名打印样式。AutoCAD 根据您在打印样式定义中指定的特性设置打印图形。打印样式在附加到布局或视口的打印样式表中定义。命名打印样式表是文件扩展名为 .stb 的文件。

言论

此属性的初始值为。acPolicyNamed

如果要更改图形的默认打印样式行为,请在打开或创建图形之前输入“非此即彼”。使用此属性更改默认打印样式行为仅影响新图形或在早期版本的 AutoCAD 中创建的图形,这些图形从未以 AutoCAD 2000 或更高版本格式保存。此设置与图形一起保存。可以使用迁移实用程序从保存图形开始更改图形的默认行为。但是,一旦使用 acPolicyNamed 保存图形作为默认行为,就无法将其更改为。acPolicyLegacyacPolicyNamedacPolicyLegacyacPolicyNamedacPolicyLegacy

例子

工 务 局:

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

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

    ' Modify the PlotPolicy preference by toggling the value
    ACADPref.PlotPolicy = acPolicyNamed
    MsgBox "The PlotPolicy preference has been set to: " & ACADPref.PlotPolicy

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

Visual LISP:

(vl-load-com)
(defun c:Example_PlotPolicy()
    ;; This example reads and modifies the PlotPolicy
    ;; 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-PlotPolicy (vla-get-Output preferences)))
    (alert (strcat "The PlotPolicy preference is set to: " (itoa originalValue)))

    ;; Modify the PlotPolicy preference by toggling the value
    (vla-put-PlotPolicy (vla-get-Output preferences) acPolicyNamed)
    (alert (strcat "The PlotPolicy preference has been set to: " (itoa (vla-get-PlotPolicy (vla-get-Output preferences)))))

    ;; Reset the preference back to its original value
    (vla-put-PlotPolicy (vla-get-Output preferences) originalValue)
    (alert (strcat "The PlotPolicy preference was reset back to: " (itoa originalValue)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 18:08

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部