CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2022 开发者帮助

DefaultPlotStyleTable 属性 (ActiveX)

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

DefaultPlotStyleTable 属性 (ActiveX)

指定要附着到新图形的缺省打印样式表。

支持的平台:仅限 Windows

签名

VBA:

object.DefaultPlotStyleTable
对象

类型:首选项输出

此属性应用于的对象。

属性值

只读:

类型:字符串

打印样式表的扩展名为 .ctb.stb,包含并定义打印样式。

言论

如果使用的是与颜色相关的打印样式,则此选项可以设置为在搜索路径中找到的任何与颜色相关的打印样式表以及值“None”。如果使用命名的打印样式,则此选项可以设置为任何命名的打印样式表。

若要设置与颜色相关的打印样式,请使用该属性。PlotPolicy

例子

VBA:

Sub Example_DefaultPlotStyleTable()
    ' This example reads and modifies the preference value that
    ' specifies the default plot style table to attach to new drawings.
    '
    ' Note: You may want to change the path of the new plot style table below.
    
    Dim ACADPref As AcadPreferencesOutput
    Dim CurrentFile As String
    
    Const NewFile = "c:\monochrome.ctb"
    
    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Output
    
    ' Read and display the current plot style table path
    CurrentFile = ACADPref.DefaultPlotStyleTable
    If CurrentFile = "" Then
        MsgBox "There is no current plot style table being used", vbInformation
    Else
        MsgBox "The current plot style table is: " & CurrentFile
    End If

    ' Use a new plot style table
    ACADPref.DefaultPlotStyleTable = NewFile
    
    ' Read and display the new plot style table path
    CurrentFile = ACADPref.DefaultPlotStyleTable
    MsgBox "The new plot style table is: " & CurrentFile, vbInformation

End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_DefaultPlotStyleTable()
    ;; This example reads and modifies the preference value that
    ;; specifies the default plot style table to attach to new drawings.
    ;;
    ;; Note: You may want to change the path of the new plot style table below.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))

    (setq NewFile (strcat (vla-get-PrinterStyleSheetPath (vla-get-Files preferences)) "\\monochrome.ctb"))
    
    ;; Get the drafting preferences object
    (setq ACADPref (vla-get-Output preferences))
    
    ;; Read and display the current plot style table path
    (setq CurrentFile (vla-get-DefaultPlotStyleTable ACADPref))
    (if (= CurrentFile "")
        (alert "There is no current plot style table being used.")
        (alert (strcat "The current plot style table is: " CurrentFile))
    )

    ;; Use a new plot style table
    (vla-put-DefaultPlotStyleTable ACADPref NewFile)
    
    ;; Read and display the new plot style table path
    (alert (strcat "The new plot style table is: " (vla-get-DefaultPlotStyleTable ACADPref)))

    (vla-put-DefaultPlotStyleTable ACADPref CurrentFile)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 11:40

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部