← Inbox

C3D-0241 · 260612 Springdale: add SANITARY SEWER EASEMENT 1 legal description to the 22X17 sheet done

Places the easement property-line description as MText on the 22X17 layout, layer BLOCK_CLOSURE, ARIAL style at height 0.075, 5.15 in wrap width, TopLeft-anchored at (23.525, 4.55). That is the clear band in the right note column between the sheet border (y=0.230) and the UPC dig block (y=4.722) - 4.49 in available, ~3.95 in needed. Verifies extents on read-back and warns if it overruns the border, the column, or the dig block. Regen last.

Script file
C3D-0241.cs
Target
260612-Springdale Sanitary Sewer Extension As-Built 60.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// Add the SANITARY SEWER EASEMENT 1 legal description to the 22X17 layout.
//
// PLACEMENT: the right-hand note column is clear from y=0.230 up to the UPC dig block at
// y=4.722 - 4.49 in of empty height between x=23.51 and x=28.66. Anchored TopLeft at
// (23.525, 4.55) so the left edge lines up with the certificate and notes stacked above it,
// and the text grows DOWNWARD into that empty band.
//
// SIZE: height 0.075 in the ARIAL style (the user wants Arial everywhere). The sheet's other
// notes run 0.06-0.08 so this matches. At 5.15 in wide that is ~124 chars/line, ~34 lines,
// ~3.95 in tall - it clears the dig block with margin.
//
// MTEXT ESCAPING: P preceded by a backslash is the hard-return code, and backslash/brace are
// control characters, so they are doubled/escaped in the generated string below. The whole
// thing is a C# VERBATIM string (@"...") because a normal string literal would eat the
// backslashes - that mistake (CS1009) has cost several tickets before.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var lt = (LayerTable)Tx.GetObject(Db.LayerTableId, OpenMode.ForRead);

const string LAYER = "BLOCK_CLOSURE";      // same layer as the other sheet notes
if (!lt.Has(LAYER)) { Log("layer " + LAYER + " missing"); return; }

BlockTableRecord sheet = null;
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 == "22X17") { sheet = (BlockTableRecord)Tx.GetObject(btrId, OpenMode.ForWrite); break; }
}
if (sheet == null) { Log("22X17 layout not found"); return; }

var tst = (TextStyleTable)Tx.GetObject(Db.TextStyleTableId, OpenMode.ForRead);
ObjectId styleId = tst.Has("ARIAL") ? tst["ARIAL"] : Db.Textstyle;
Log("text style: " + (tst.Has("ARIAL") ? "ARIAL (swissb.ttf)" : "drawing default"));

var mt = new MText();
mt.SetDatabaseDefaults();
mt.TextStyleId = styleId;
mt.TextHeight = 0.075;
mt.Width = 5.15;
mt.Attachment = AttachmentPoint.TopLeft;
mt.Location = new Point3d(23.525, 4.55, 0);
mt.Layer = LAYER;
mt.Contents = @"SANITARY SEWER EASEMENT 1\PPROPERTY LINE DESCRIPTION\P\PALL THAT TRACT OR PARCEL OF LAND LYING AND BEING IN LAND LOTS 3 AND 4 OF THE 11TH DISTRICT, HENRY COUNTY, GEORGIA, AND BEING MORE PARTICULARLY DESCRIBED AS FOLLOWS:\P\PCOMMENCING AT THE INTERSECTION OF THE EASTERLY RIGHT-OF-WAY OF SPRINGDALE ROAD (80' R/W) AND THE SOUTHERLY RIGHT-OF-WAY OF EAST LAKE PARKWAY (150' R/W);\PTHENCE, ____________________________________, ________ FEET TO A POINT ON THE EASTERLY RIGHT-OF-WAY OF SPRINGDALE ROAD; SAID POINT BEING THE TRUE POINT OF BEGINNING;\P\PTHENCE, LEAVING SAID EASTERLY RIGHT-OF-WAY, SOUTH 89 DEGREES 05 MINUTES 51 SECONDS EAST, 122.81 FEET TO A POINT;\PTHENCE, NORTH 44 DEGREES 35 MINUTES 15 SECONDS EAST, 96.05 FEET TO A POINT;\PTHENCE, NORTH 83 DEGREES 08 MINUTES 58 SECONDS WEST, 39.54 FEET TO A POINT;\PTHENCE, NORTH 06 DEGREES 52 MINUTES 19 SECONDS EAST, 30.01 FEET TO A POINT;\PTHENCE, SOUTH 83 DEGREES 08 MINUTES 31 SECONDS EAST, 70.10 FEET TO A POINT;\PTHENCE, SOUTH 89 DEGREES 51 MINUTES 54 SECONDS EAST, 90.26 FEET TO A POINT;\PTHENCE, SOUTH 48 DEGREES 17 MINUTES 12 SECONDS EAST, 25.40 FEET TO A POINT;\PTHENCE, NORTH 58 DEGREES 00 MINUTES 43 SECONDS EAST, 122.94 FEET TO A POINT;\PTHENCE, SOUTH 41 DEGREES 16 MINUTES 59 SECONDS WEST, 104.22 FEET TO A POINT;\PTHENCE, SOUTH 58 DEGREES 00 MINUTES 43 SECONDS WEST, 45.61 FEET TO A POINT;\PTHENCE, NORTH 48 DEGREES 17 MINUTES 11 SECONDS WEST, 36.52 FEET TO A POINT;\PTHENCE, NORTH 89 DEGREES 48 MINUTES 03 SECONDS WEST, 74.32 FEET TO A POINT;\PTHENCE, SOUTH 44 DEGREES 35 MINUTES 20 SECONDS WEST, 133.15 FEET TO A POINT;\PTHENCE, NORTH 89 DEGREES 05 MINUTES 51 SECONDS WEST, 139.64 FEET TO A POINT ON THE EASTERLY RIGHT-OF-WAY OF SPRINGDALE ROAD;\PTHENCE ALONG SAID EASTERLY RIGHT-OF-WAY, ALONG A CURVE TO THE LEFT, AN ARC DISTANCE OF 30.27 FEET, SAID CURVE HAVING A RADIUS OF 947.03 FEET AND BEING SUBTENDED BY A CHORD OF 30.26 FEET, AT NORTH 08 DEGREES 29 MINUTES 09 SECONDS EAST, TO THE TRUE POINT OF BEGINNING;\P\PSAID EASEMENT CONTAINING 0.356 ACRES (15,504.66 SQUARE FEET)";

sheet.AppendEntity(mt);
Tx.AddNewlyCreatedDBObject(mt, true);

var back = (MText)Tx.GetObject(mt.ObjectId, OpenMode.ForRead);
var e = back.GeometricExtents;
Log(string.Format("MTEXT [{0}] style-height={1:F3} boxwidth={2:F3} layer={3} chars={4}",
    back.Handle, back.TextHeight, back.Width, back.Layer, back.Contents.Length));
Log(string.Format("  extents ({0:F3},{1:F3}) - ({2:F3},{3:F3})   {4:F3} wide x {5:F3} tall (verified)",
    e.MinPoint.X, e.MinPoint.Y, e.MaxPoint.X, e.MaxPoint.Y,
    e.MaxPoint.X - e.MinPoint.X, e.MaxPoint.Y - e.MinPoint.Y));
if (e.MinPoint.Y < 0.230) Log("  WARNING: extends below the sheet border (y=0.230)");
if (e.MaxPoint.X > 28.90) Log("  WARNING: extends past the note column (x=28.90)");
if (e.MaxPoint.Y > 4.722) Log("  WARNING: overlaps the UPC dig block (y=4.722)");
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\260612-C-Store Sewer As-Built 60.dwg
Message
Executed C3D-0241 (0 entities touched).
Entities
Duration
671 ms
Civil 3D
25.0.0.0

Log

text style: ARIAL (swissb.ttf)
MTEXT [3012C] style-height=0.075 boxwidth=5.150 layer=BLOCK_CLOSURE chars=2044
  extents (23.525,0.394) - (28.675,4.550)   5.150 wide x 4.156 tall (verified)

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.