C3D-0271 · 260714 Huckaby: where is the paper in layout coordinates done
READ-ONLY. Layout origin 0,0 is the lower-left of the PRINTABLE area, not the paper, so margins offset everything. Reports paper and printable bounds in layout coordinates for both 17X11 and 11X17, plus where each title block actually sits.
C# payload
// Where is the PAPER in layout coordinates? Layout origin (0,0) is the lower-left of the
// PRINTABLE area, not the paper, so margins shift everything.
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 lay = (Layout)Tx.GetObject(rec.LayoutId, OpenMode.ForRead);
if (lay.LayoutName != "17X11" && lay.LayoutName != "11X17") continue;
var m = lay.PlotPaperMargins;
double pw = lay.PlotPaperSize.X/25.4, ph = lay.PlotPaperSize.Y/25.4;
double ml = m.MinPoint.X/25.4, mb = m.MinPoint.Y/25.4, mr = m.MaxPoint.X/25.4, mt = m.MaxPoint.Y/25.4;
Log("=== " + lay.LayoutName + " ===");
Log(" media " + lay.CanonicalMediaName + string.Format(" paper {0:F3} x {1:F3}", pw, ph));
Log(string.Format(" margins L{0:F3} B{1:F3} R{2:F3} T{3:F3}", ml, mb, mr, mt));
Log(string.Format(" PRINTABLE area = {0:F3} x {1:F3}, and layout (0,0) is its lower-left",
pw-ml-mr, ph-mb-mt));
Log(string.Format(" => PAPER occupies layout coords x {0:F3}..{1:F3}, y {2:F3}..{3:F3}",
-ml, -ml+pw, -mb, -mb+ph));
Log(string.Format(" => PRINTABLE occupies x {0:F3}..{1:F3}, y {2:F3}..{3:F3}",
0.0, pw-ml-mr, 0.0, ph-mb-mt));
// where is the title block?
foreach (ObjectId id in rec) {
var br = Tx.GetObject(id, OpenMode.ForRead) as BlockReference;
if (br == null) continue;
var e = br.GeometricExtents;
Log(string.Format(" BLOCK {0,-16} ({1:F3},{2:F3})-({3:F3},{4:F3})",
br.Name, e.MinPoint.X, e.MinPoint.Y, e.MaxPoint.X, e.MaxPoint.Y));
}
Log("");
}
Result
Log
=== 17X11 === media ANSI_B_(17.00_x_11.00_Inches) paper 17.000 x 11.000 margins L0.250 B0.750 R0.250 T0.750 PRINTABLE area = 16.500 x 9.500, and layout (0,0) is its lower-left => PAPER occupies layout coords x -0.250..16.750, y -0.750..10.250 => PRINTABLE occupies x 0.000..16.500, y 0.000..9.500 BLOCK SS_BLOCK_17X11 (0.243,0.330)-(16.670,10.670) BLOCK SS_LEGEND (14.091,7.771)-(16.795,10.979) === 11X17 === media ANSI_full_bleed_B_(11.00_x_17.00_Inches) paper 11.000 x 17.000 margins L0.000 B0.000 R0.000 T0.000 PRINTABLE area = 11.000 x 17.000, and layout (0,0) is its lower-left => PAPER occupies layout coords x -0.000..11.000, y -0.000..17.000 => PRINTABLE occupies x 0.000..11.000, y 0.000..17.000 BLOCK SS_LEGEND (7.590,13.371)-(10.294,16.578) BLOCK SS_BLOCK_11X17 (0.165,0.287)-(10.815,16.765)
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.