Q:
I am using AutoCAD ActiveX interface from C# (or using VB.NET) and I need to get the list of plot devices returned from the method GetPlotDeviceNames()
A:
The generic System.Object returned from GetPlotDeviceNames can be cast to an array of strings to access the name for each plot device.
Here is an example:
[CommandMethod("GetPlotDeviceNames")]
public void GetPlotDeviceNames()
{
AcadApplication acadApp = Application.AcadApplication
as AcadApplication;
AcadLayout layout = acadApp.ActiveDocument.ActiveLayout;
string[] devices = (string[])layout.GetPlotDeviceNames();
foreach (string device in devices)
{
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(
"\nPlot Device: " + device);
}
<
p style=”line-height: normal;margin: 0in 0in 0pt” class=”MsoNormal”>}

Leave a Reply