C3D-0259 · 260714 Huckaby: clear the redundant 90-degree plot rotation on 17X11 error
The media is genuinely landscape (431.8x279.4mm) but the layout still carried PlotRotation=Degrees090 from when the media was portrait, so the printable area was being rotated back to portrait and the 17x11 border hung off the paper. Sets rotation to Degrees000, plot type Layout, 1:1, origin 0,0, and reports the resulting printable area against the 17x11 border.
C# payload
// The media is genuinely landscape (ANSI_B_(17.00_x_11.00_Inches), 431.8 x 279.4 mm) but the
// layout still carries PlotRotation=Degrees090 from when the media was the PORTRAIT ANSI B and
// rotation was doing the flipping. Rotating an already-landscape sheet turns the printable area
// back to portrait, which is why the border hangs off the paper.
// Clear the rotation to Degrees000 and set the plot origin so the sheet is centred.
LayoutManager.Current.CurrentLayout = "17X11";
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
foreach (ObjectId btrId in bt) {
var rec = (BlockTableRecord)Tx.GetObject(btrId, OpenMode.ForRead);
if (!rec.IsLayout) continue;
var lay0 = (Layout)Tx.GetObject(rec.LayoutId, OpenMode.ForRead);
if (lay0.LayoutName != "17X11") continue;
var lay = (Layout)Tx.GetObject(rec.LayoutId, OpenMode.ForWrite);
var psv = PlotSettingsValidator.Current;
Log("before: media=" + lay.CanonicalMediaName + " rot=" + lay.PlotRotation
+ string.Format(" paper {0:F1}x{1:F1}mm", lay.PlotPaperSize.X, lay.PlotPaperSize.Y));
psv.SetPlotRotation(lay, PlotRotation.Degrees000);
psv.SetPlotType(lay, Autodesk.AutoCAD.DatabaseServices.PlotType.Layout);
psv.SetUseStandardScale(lay, true);
psv.SetStdScaleType(lay, StdScaleType.StdScale1To1);
psv.SetPlotCentered(lay, false);
psv.SetPlotOrigin(lay, new Point2d(0, 0));
var back = (Layout)Tx.GetObject(rec.LayoutId, OpenMode.ForRead);
var m = back.PlotPaperMargins;
Log("after : media=" + back.CanonicalMediaName + " rot=" + back.PlotRotation
+ string.Format(" paper {0:F1}x{1:F1}mm", back.PlotPaperSize.X, back.PlotPaperSize.Y));
Log(string.Format("margins L{0:F3} B{1:F3} R{2:F3} T{3:F3} (mm)", m.MinPoint.X, m.MinPoint.Y, m.MaxPoint.X, m.MaxPoint.Y));
// printable area in inches
double pw = back.PlotPaperSize.X / 25.4, ph = back.PlotPaperSize.Y / 25.4;
double aw = pw - (m.MinPoint.X + m.MaxPoint.X) / 25.4;
double ah = ph - (m.MinPoint.Y + m.MaxPoint.Y) / 25.4;
Log(string.Format("paper {0:F2} x {1:F2} in printable {2:F2} x {3:F2} in (sheet border is 17.00 x 11.00) (verified)",
pw, ph, aw, ah));
if (aw < 17.0 || ah < 11.0)
Log("NOTE: printable area is smaller than the 17x11 border - the border will clip unless the media is full-bleed.");
}
Ed.Regen();
Result
Log
before: media=ANSI_B_(17.00_x_11.00_Inches) rot=Degrees090 paper 431.8x279.4mm
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.