PlotInfo error

PlotInfo error

Anonymous
Not applicable
319 Views
0 Replies
Message 1 of 1

PlotInfo error

Anonymous
Not applicable
Hello everybody

I am having problem in generating PlotInfo with following code. What I am trying to do is create Layout and apply generated plot-info using layout.CopyForm(GetPlotInfo()).

public static PlotInfo GetPlotInfo()
{
string LAYOUT_NAME = "Layout1";
string PRINTER = "DWF6 ePlot.pc3";
string PAPERSIZE = "ISO_A1_(841.00_x_594.00_MM)";
StdScaleType SCALE = StdScaleType.ScaleToFit;
PlotRotation ROTATION = PlotRotation.Degrees000;
ClsMethods.SetLayout(LAYOUT_NAME);

PlotInfo plotInfo = new PlotInfo();
PlotInfoValidator piValidator = new PlotInfoValidator();
PlotSettings plotSet = new PlotSettings(false);
try
{

PlotSettingsValidator psValidator = PlotSettingsValidator.Current;
psValidator.RefreshLists(plotSet);

plotInfo.Layout = LayoutManager.Current.GetLayoutId(LAYOUT_NAME);
psValidator.SetPlotPaperUnits(plotSet, PlotPaperUnit.Millimeters);
psValidator.SetPlotRotation(plotSet, ROTATION);
psValidator.SetPlotType(plotSet, Autodesk.AutoCAD.DatabaseServices.PlotType.Extents);

psValidator.SetUseStandardScale(plotSet, true);

psValidator.SetStdScaleType(plotSet, SCALE);
psValidator.SetPlotCentered(plotSet, false);
psValidator.SetPlotOrigin(plotSet, new Point2d(0.0, 0.75));
psValidator.SetPlotConfigurationName(plotSet, PRINTER, PAPERSIZE);

psValidator = null;
plotSet.ShadePlot = PlotSettingsShadePlotType.AsDisplayed;
plotSet.PrintLineweights = true;
plotSet.ScaleLineweights = false;
plotInfo.OverrideSettings = plotSet;
piValidator.Validate(plotInfo);
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
MessageBox.Show(ex.Message);
}

return plotInfo;
}
0 Likes
320 Views
0 Replies
Replies (0)