印刷スタイルは、出力におけるオブジェクトの表示方法をコントロールするオブジェクトのプロパティを優先させるために使用されます。レイアウトまたはページの設定に割り当てられている印刷スタイルは、CurrentStyleSheet プロパティに格納されます。PlotSettings オブジェクトに印刷スタイルを割り当てるには、PlotSettingsValidator オブジェクトの SetCurrentStyleSheet メソッドを使用します。図面を作成した方法に基づいて、色従属の印刷スタイルまたは名前の付いた印刷スタイルを使用します。どのタイプの印刷スタイルが図面で使用されているかを調べるには、現在のデータベースの PlotStyleMode プロパティを使用することができます。
PlotSettingsValidator オブジェクトの GetPlotStyleSheetList メソッドを使用して、使用可能なすべての印刷スタイルのリストを取得することができます。一覧表示された印刷スタイルは、[印刷]または[ページ設定]ダイアログ ボックスに表示されるものと同じものです。
この例では、使用可能な印刷スタイルを一覧表示します。
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
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);
}
}