CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

打印样式 (.NET)

2023-1-1 09:27| 发布者: admin| 查看: 456| 评论: 0|来自: AutoCAD

打印样式用于覆盖某些控制对象在输出中的显示方式的对象属性。指定给布局或页面设置的打印样式存储在属性中。您可以使用对象的方法为对象指定打印样式。根据图形的创建方式,它使用与颜色相关的打印样式或命名的打印样式。可以使用当前数据库的属性来确定图形使用的打印样式类型。CurrentStyleSheetSetCurrentStyleSheetPlotSettingsValidatorPlotSettingsPlotStyleMode

您可以使用对象的方法获取所有可用打印样式的列表。列出的打印样式与“打印”或“页面设置”对话框中显示的样式相同。GetPlotStyleSheetListPlotSettingsValidator

列出可用的打印样式

本示例列出可用的打印样式。

VB.NET

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices

' Lists the available plot styles
<CommandMethod("PlotStyleList")> _
Public Shared Sub PlotStyleList()
    ' Get the current document and database, and start a transaction
    Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument

    acDoc.Editor.WriteMessage(vbLf & "Plot styles: ")

    For Each plotStyle As String In PlotSettingsValidator.Current.GetPlotStyleSheetList()
        ' Output the names of the available plot styles
        acDoc.Editor.WriteMessage(vbLf & "  " & plotStyle)
    Next
End Sub

C#

using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;

// Lists the available plot styles
[CommandMethod("PlotStyleList")]
public static void PlotStyleList()
{
    // Get the current document and database, and start a transaction
    Document acDoc = Application.DocumentManager.MdiActiveDocument;

    acDoc.Editor.WriteMessage("\nPlot styles: ");

    foreach (string plotStyle in PlotSettingsValidator.Current.GetPlotStyleSheetList())
    {
        // Output the names of the available plot styles
        acDoc.Editor.WriteMessage("\n  " + plotStyle);
    }
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 15:30

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部