← Inbox

C3D-0139 · Road labels at 3.2 height, NAME (50' R/W) format [ROAD-LABELS-2] done

Redraws both road labels on ROAD_TEXT at height 3.2 instead of 6.0 and in the user's format NAME (50' R/W). Erases the previous ROAD_TEXT pass first so it is not additive. Camellia Cir stays curved as one MText per character along the centreline; SdskCurvedText is registered in this session but has no managed wrapper so it cannot be constructed from a script.

Script file
C3D-0139.cs
Target
active document · model space
Author
claude
Approved
yes · reviewer
Timeout
180s

C# payload

// Road labels REDRAWN: height 3.2 (was 6.0 - too big) and the user's format "NAME (50' R/W)".
//
// Erases the previous ROAD_TEXT labels first so this is not additive.
//
// NOTE ON TEXT-ALONG-CURVE: the proper entity is SdskCurvedText (DXF SDSK_CURVEDTEXT, app SDSK) -
// it IS registered in this session, but it has NO managed .NET wrapper in any loaded assembly, so
// a script cannot construct one. Express Tools ARCTEXT/AcDbArcAlignedText is NOT registered here.
// Until a command-driven path is proven, the curve is approximated with one MText per character
// placed along the centreline and rotated to the local tangent.
const string LAYER = "ROAD_TEXT";
const double H = 3.2;

var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForWrite);
EnsureLayer(LAYER, 7);

// clear the previous pass
int erased = 0;
var doomed = new List<ObjectId>();
foreach (ObjectId id in ms) {
    var e = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (e != null && !e.IsErased && e.Layer == LAYER) doomed.Add(id);
}
foreach (ObjectId id in doomed) { Tx.GetObject(id, OpenMode.ForWrite).Erase(); erased++; }
Log("erased " + erased + " previous ROAD_TEXT entities");

    {
        var mt = new MText {
            Location   = new Point3d(2238197.8526, 1325215.0327, 0.0),
            Contents   = @"SWEETBRIAR LN (50' R/W)",
            TextHeight = H,
            Rotation   = -5.075729,
            Attachment = AttachmentPoint.MiddleCenter,
        };
        mt.Layer = LAYER;
        ms.AppendEntity(mt); Tx.AddNewlyCreatedDBObject(mt, true);
        Log("  SWEETBRIAR LN (50' R/W) placed, height " + H);
    }
    {
        int n = 0;
        { var c = new MText { Location = new Point3d(2238308.4094, 1325215.4130, 0.0), Contents = @"C",
              TextHeight = H, Rotation = -0.696269, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238309.9316, 1325214.1405, 0.0), Contents = @"A",
              TextHeight = H, Rotation = -0.696269, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238311.4538, 1325212.8681, 0.0), Contents = @"M",
              TextHeight = H, Rotation = -0.696269, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238312.9760, 1325211.5956, 0.0), Contents = @"E",
              TextHeight = H, Rotation = -0.696269, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238314.4982, 1325210.3232, 0.0), Contents = @"L",
              TextHeight = H, Rotation = -0.696269, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238315.9945, 1325209.0226, 0.0), Contents = @"L",
              TextHeight = H, Rotation = -0.792437, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238317.3875, 1325207.6098, 0.0), Contents = @"I",
              TextHeight = H, Rotation = -0.792437, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238318.7804, 1325206.1971, 0.0), Contents = @"A",
              TextHeight = H, Rotation = -0.792437, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238321.4280, 1325203.2450, 0.0), Contents = @"C",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238322.7114, 1325201.7320, 0.0), Contents = @"I",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238323.9949, 1325200.2191, 0.0), Contents = @"R",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238326.5618, 1325197.1931, 0.0), Contents = @"(",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238327.8452, 1325195.6802, 0.0), Contents = @"5",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238329.1286, 1325194.1672, 0.0), Contents = @"0",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238330.4121, 1325192.6543, 0.0), Contents = @"'",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238332.9790, 1325189.6284, 0.0), Contents = @"R",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238334.2624, 1325188.1154, 0.0), Contents = @"/",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238335.5458, 1325186.6025, 0.0), Contents = @"W",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        { var c = new MText { Location = new Point3d(2238336.8293, 1325185.0895, 0.0), Contents = @")",
              TextHeight = H, Rotation = -0.867289, Attachment = AttachmentPoint.MiddleCenter };
          c.Layer = LAYER; ms.AppendEntity(c); Tx.AddNewlyCreatedDBObject(c, true); n++; }
        Log("  CAMELLIA CIR (50' R/W) placed as " + n + " character(s) curved along the arc");
    }

int total = 0;
foreach (ObjectId id in ms) {
    var e = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (e != null && !e.IsErased && e.Layer == LAYER) total++;
}
Log("ROAD_TEXT now holds " + total + " entities at height " + H + " (verified)");
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260802 - 4082 Sweetbriar Ln, Forest Park, GA 30297, USA\260802 - 4082 Sweetbriar Ln.dwg
Message
Executed C3D-0139 (0 entities touched).
Entities
Duration
438 ms
Civil 3D
25.0.0.0

Log

erased 18 previous ROAD_TEXT entities
  SWEETBRIAR LN (50' R/W) placed, height 3.2
  CAMELLIA CIR (50' R/W) placed as 19 character(s) curved along the arc
ROAD_TEXT now holds 20 entities at height 3.2 (verified)

Notes

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

No notes yet.