CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

GetPlotStyleTableNames Method (ActiveX)

2023-1-4 07:13| 发布者: admin| 查看: 624| 评论: 0|来自: AutoCAD

摘要: 获取所有可用的打印样式表名称。

获取所有可用的打印样式表名称。

支持的平台:仅窗口

签名

工 务 局:

RetVal = object.GetPlotStyleTableNames()
对象

类型:布局绘图配置

此方法适用的对象。

返回值(RetVal)

类型:变体(字符串数组)

系统的可用打印样式表名称的数组。

言论

您应该在第一次使用此方法之前调用。调用后,除非在会话期间绘图设备信息发生更改,否则无需再次调用它。RefreshPlotDeviceInfoRefreshPlotDeviceInfo

GetPlotStyleTableNames返回在系统上找到的所有可用打印样式表,包括 CTB 和 STB 文件。要过滤一种类型的打印样式表的结果,请使用 PSTYLEMODE 系统变量。

例子

工 务 局:

Sub Example_GetPlotStyleTableNames()
    ' This example gets the current plot device information
    ' and then displays the list of plot device names,
    ' media names, localized media names, and plot style
    ' table entries.
    Dim Layout As ACADLayout
    Set Layout = ThisDrawing.ModelSpace.Layout
    
    ' Refresh the current plot information for
    ' this session.
    Layout.RefreshPlotDeviceInfo
    
    ' List all the valid device names for the system
    Dim plotDevices As Variant
    plotDevices = Layout.GetPlotDeviceNames()
    
    Dim x As Integer
    For x = LBound(plotDevices) To UBound(plotDevices)
        MsgBox plotDevices(x)
    Next
    
    ' List all the media names, and their localized version
    Dim mediaNames As Variant
    mediaNames = Layout.GetCanonicalMediaNames()
    
    For x = LBound(mediaNames) To UBound(mediaNames)
        MsgBox mediaNames(x)
        MsgBox Layout.GetLocaleMediaName(mediaNames(x))
    Next
    
    ' List all the entries in the plot style table
    Dim styleNames As Variant
    styleNames = Layout.GetPlotStyleTableNames()
    
    For x = LBound(styleNames) To UBound(styleNames)
        MsgBox styleNames(x)
    Next
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_GetPlotStyleTableNames()
    ;; This example gets the current plot device information
    ;; and then displays the list of plot device names,
    ;; media names, localized media names, and plot style
    ;; table entries.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    (setq Layout (vla-get-Layout (vla-get-ModelSpace doc)))
    
    ;; Refresh the current plot information for
    ;; this session.
    (vla-RefreshPlotDeviceInfo Layout)
    
    ;; List all the valid device names for the system
    (setq plotDevices (vlax-variant-value (vla-GetPlotDeviceNames Layout)))
    
    (setq x 0)
    (while (>= (vlax-safearray-get-u-bound plotDevices 1) x)
        (alert (vlax-safearray-get-element plotDevices x))
        (setq x (1+ x))
    )
    
    ;; List all the media names, and their localized version
    (setq mediaNames (vlax-variant-value (vla-GetCanonicalMediaNames Layout)))

    (setq x 0)
    (while (>= (vlax-safearray-get-u-bound mediaNames 1) x)
        (alert (vlax-safearray-get-element mediaNames x))
        (alert (vla-GetLocaleMediaName Layout (vlax-safearray-get-element mediaNames x)))
        (setq x (1+ x))
    )
    
    ;; List all the entries in the plot style table
    (setq styleNames (vlax-variant-value (vla-GetPlotStyleTableNames Layout)))
    
    (setq x 0)
    (while (>= (vlax-safearray-get-u-bound styleNames 1) x)
        (alert (vlax-safearray-get-element styleNames x))
        (setq x (1+ x))
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 03:26

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部