レイアウトまたはページ設定の印刷デバイスの名前は PlotConfigurationName プロパティに格納されます。名前はシステムにあるデバイスのいずれかと一致する必要があり、一致しない場合は既定のデバイスが使用されます。
AutoCAD でアクセスできる、使用可能なすべてのシステム デバイスと非システム デバイスの一覧は、PlotSettingsValidator オブジェクトの GetPlotDeviceList メソッドを使用して取得できます。一覧表示されたデバイスは、[印刷]または[ページ設定]ダイアログ ボックスに表示されるものと同じです。
この例では、使用可能な出力デバイスを一覧表示します。
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.PlottingServices
' Lists the available plotters (plot configuration [PC3] files)
<CommandMethod("PlotterList")> _
Public Shared Sub PlotterList()
' Get the current document and database, and start a transaction
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
acDoc.Editor.WriteMessage(vbLf & "Plot devices: ")
For Each plotDevice As String In PlotSettingsValidator.Current.GetPlotDeviceList()
' Output the names of the available plotter devices
acDoc.Editor.WriteMessage(vbLf & " " & plotDevice)
Next
End Sub
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.PlottingServices;
// Lists the available plotters (plot configuration [PC3] files)
[CommandMethod("PlotterList")]
public static void PlotterList()
{
// Get the current document and database, and start a transaction
Document acDoc = Application.DocumentManager.MdiActiveDocument;
acDoc.Editor.WriteMessage("\nPlot devices: ");
foreach (string plotDevice in PlotSettingsValidator.Current.GetPlotDeviceList())
{
// Output the names of the available plotter devices
acDoc.Editor.WriteMessage("\n " + plotDevice);
}
}