C3D-NOTETEST · Test note placement on 22X17 C done
Places a NOTES heading plus three sample notes at 0.08/0.10/0.12 inch text height on the 22X17 C sheet (paper space, layer C-ANNO-NOTE) so position, size and wrap width can be judged before the real notes go in.
C# payload
// Test note placement on the 22X17 C sheet, so the user can judge position/size/style before
// the real notes go in. Paper space, sheet inches, NOT model space.
// Title block occupies (0.25,0.26)-(21.75,16.74) so this sits inside the left border area.
// Host owns Tx; host regens after commit.
const string LAYOUT = "22X17 C", LAYER = "C-ANNO-NOTE";
var layDict = (DBDictionary)Tx.GetObject(Db.LayoutDictionaryId, OpenMode.ForRead);
var layout = (Layout)Tx.GetObject(layDict.GetAt(LAYOUT), OpenMode.ForRead);
var ps = (BlockTableRecord)Tx.GetObject(layout.BlockTableRecordId, OpenMode.ForWrite);
double sw = layout.PlotPaperSize.X / 25.4, sh = layout.PlotPaperSize.Y / 25.4;
Log($"sheet {sw:F2} x {sh:F2} in");
EnsureLayer(LAYER, 2);
// heading + a couple of sample numbered notes at three sizes so scale can be judged
var samples = new (double x, double y, double h, double w, string txt)[] {
(0.75, 16.00, 0.15, 7.0, "NOTES:"),
(0.75, 15.70, 0.10, 7.0, "1. THIS IS A 0.10\" TEST NOTE. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG TO SHOW HOW A LONGER LINE WRAPS AT A 7 INCH WIDTH ON THIS SHEET."),
(0.75, 15.10, 0.08, 7.0, "2. THIS IS A 0.08\" TEST NOTE. SMALLER BODY TEXT FOR COMPARISON, SAME WRAP WIDTH SO THE TWO CAN BE JUDGED SIDE BY SIDE."),
(0.75, 14.60, 0.12, 7.0, "3. THIS IS A 0.12\" TEST NOTE. LARGER BODY TEXT FOR COMPARISON."),
};
int n = 0;
foreach (var s0 in samples)
{
var mt = new MText {
Location = new Point3d(s0.x, s0.y, 0.0),
Contents = s0.txt,
TextHeight = s0.h,
Width = s0.w,
Attachment = AttachmentPoint.TopLeft,
};
mt.Layer = LAYER;
ps.AppendEntity(mt);
Tx.AddNewlyCreatedDBObject(mt, true);
var e = mt.GeometricExtents;
Log($" h={s0.h:F2}\" at ({s0.x},{s0.y}) -> extents ({e.MinPoint.X:F2},{e.MinPoint.Y:F2})-({e.MaxPoint.X:F2},{e.MaxPoint.Y:F2})");
n++;
}
Log($"Placed {n} test notes on '{LAYOUT}' layer '{LAYER}'. Erase with the undo ticket once judged.");
Result
Log
sheet 22.00 x 17.00 in h=0.15" at (0.75,16) -> extents (0.75,15.85)-(7.75,16.00) h=0.10" at (0.75,15.7) -> extents (0.75,15.41)-(7.75,15.70) h=0.08" at (0.75,15.1) -> extents (0.75,14.87)-(7.75,15.10) h=0.12" at (0.75,14.6) -> extents (0.75,14.46)-(7.75,14.60) Placed 4 test notes on '22X17 C' layer 'C-ANNO-NOTE'. Erase with the undo ticket once judged.
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.