CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

相关分类

绘图设备 (.NET)

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

布局或页面设置的打印设备名称存储在属性中。该名称应与系统上的某个设备匹配,否则将使用默认设备。PlotConfigurationName

您可以使用对象的方法获取 AutoCAD 有权访问的所有可用系统和非系统设备的列表。列出的设备与“打印”或“页面设置”对话框中显示的设备相同。GetPlotDeviceListPlotSettingsValidator

列出可用的输出设备

此示例列出了可用的输出设备。

VB.NET

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

C#

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);
    }
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部