布局的图纸尺寸选择取决于为输出配置的绘图仪或设备。每个绘图仪或设备都有一个可用的输出大小的标准列表,可以使用对象的方法获得。对象的方法可用于返回“打印”或“页面设置”对话框中显示的输出大小。分配给布局的纸张大小可以使用属性进行查询。GetCanonicalMediaNameListPlotSettingsValidatorGetLocaleMediaNamePlotSettingsValidatorCanonicalMediaName 您还可以使用属性查询布局的单位。此属性返回由 enum:,or 定义的三个值之一。如果将绘图仪配置为栅格输出,则输出大小将以像素为单位返回。PlotPaperUnitsPlotPaperUnitInchesMillimetersPixels 列出输出设备的可用纸张大小本示例列出DWF6 ePlot.pc3输出设备的纸张大小。 VB.NETImports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.PlottingServices ' Lists the available local media names for a specified plot configuration (PC3) file <CommandMethod("PlotterLocalMediaNameList")> _ Public Shared Sub PlotterLocalMediaNameList() ' Get the current document and database, and start a transaction Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument Using plSet As PlotSettings = New PlotSettings(True) Dim acPlSetVdr As PlotSettingsValidator = PlotSettingsValidator.Current ' Set the Plotter and page size acPlSetVdr.SetPlotConfigurationName(plSet, "DWF6 ePlot.pc3", _ "ANSI_A_(8.50_x_11.00_Inches)") acDoc.Editor.WriteMessage(vbLf & "Canonical and Local media names: ") Dim cnt As Integer = 0 For Each mediaName As String In acPlSetVdr.GetCanonicalMediaNameList(plSet) ' Output the names of the available media for the specified device acDoc.Editor.WriteMessage(vbLf & " " & mediaName & " | " & _ acPlSetVdr.GetLocaleMediaName(plSet, cnt)) cnt = cnt + 1 Next End Using End Sub C#using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.PlottingServices; // Lists the available local media names for a specified plot configuration (PC3) file [CommandMethod("PlotterLocalMediaNameList")] public static void PlotterLocalMediaNameList() { // Get the current document and database, and start a transaction Document acDoc = Application.DocumentManager.MdiActiveDocument; using(PlotSettings plSet = new PlotSettings(true)) { PlotSettingsValidator acPlSetVdr = PlotSettingsValidator.Current; // Set the Plotter and page size acPlSetVdr.SetPlotConfigurationName(plSet, "DWF6 ePlot.pc3", "ANSI_A_(8.50_x_11.00_Inches)"); acDoc.Editor.WriteMessage("\nCanonical and Local media names: "); int cnt = 0; foreach (string mediaName in acPlSetVdr.GetCanonicalMediaNameList(plSet)) { // Output the names of the available media for the specified device acDoc.Editor.WriteMessage("\n " + mediaName + " | " + acPlSetVdr.GetLocaleMediaName(plSet, cnt)); cnt = cnt + 1; } } } |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )
GMT+8, 2024-5-19 14:35
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.