C3D-MHTEXTMOVE · Nudge SSMH text right ~1.5 letters done
Shift all SEWER_MANHOLE_TEXT entities right by 1.5x text height.
C# payload
// Nudge all SEWER_MANHOLE_TEXT entities to the RIGHT by ~1.5 letter-widths (1.5 x text height).
using System;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
double shift = 0;
int moved = 0;
foreach (ObjectId id in ModelSpace)
{
var e = Tx.GetObject(id, OpenMode.ForRead);
if (!(e is DBText t) || !string.Equals(t.Layer, "SEWER_MANHOLE_TEXT", StringComparison.OrdinalIgnoreCase)) continue;
if (shift == 0) { shift = t.Height * 1.5; Log($"text height {t.Height:0.00} -> shifting right {shift:0.00} ft"); }
var w = (DBText)Tx.GetObject(id, OpenMode.ForWrite);
w.Position = new Point3d(w.Position.X + shift, w.Position.Y, w.Position.Z);
if (w.Justify != AttachmentPoint.BaseLeft)
w.AlignmentPoint = new Point3d(w.AlignmentPoint.X + shift, w.AlignmentPoint.Y, w.AlignmentPoint.Z);
moved++;
}
Log($"DONE. moved {moved} SEWER_MANHOLE_TEXT entities right by {shift:0.00} ft.");
Result
Log
text height 6.50 -> shifting right 9.75 ft DONE. moved 27 SEWER_MANHOLE_TEXT entities right by 9.75 ft.
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.