打印样式用于覆盖某些对象属性,这些属性控制对象在输出中的显示方式。分配给布局或页面设置的打印样式存储在属性中。使用对象的方法为对象指定打印样式。根据图形的创建方式,它使用与颜色相关的打印样式或命名的打印样式。可以使用当前数据库的属性来确定图形使用的打印样式类型。CurrentStyleSheetSetCurrentStyleSheetPlotSettingsValidatorPlotSettingsPlotStyleMode 您可以使用对象的方法获取所有可用打印样式的列表。列出的打印样式与“打印”(Plot) 或“页面设置”(Page Setup) 对话框中显示的打印样式相同。GetPlotStyleSheetListPlotSettingsValidator 列出可用的打印样式本示例列出了可用的打印样式。 VB.NETImports 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);
}
}
父主题: |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 06:58
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.