← Inbox

C3D-0238 · 260612 Springdale: pull the two overshot title-panel lines back to the sheet edge done

C3D-0236 shifted 233E5 (panel bottom rule) and 23394 (panel right edge) that were already anchored to the sheet right edge, sending them to x=11.2. Clamps both back to x=-0.043 and reports the rightmost entity in the block to confirm nothing else overshot. Regen last.

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

C# payload

// C3D-0236 shifted two lines that were already anchored to the sheet's right edge, so they now
// run past it to x=11.2. They are the title panel's bottom rule (233E5) and its right edge
// (23394). Pull both back so they terminate at the sheet inner edge x=-0.043.
Func<string, Line> getLine = hs => {
    ObjectId id;
    if (!Db.TryGetObjectId(new Handle(Convert.ToInt64(hs, 16)), out id)) return null;
    return Tx.GetObject(id, OpenMode.ForWrite) as Line;
};
const double EDGE = -0.043;

// 233E5: horizontal bottom rule, currently -10.200 -> 11.217. Clamp the right end.
var l1 = getLine("233E5");
if (l1 != null) {
    var s = l1.StartPoint; var e = l1.EndPoint;
    if (s.X > e.X) { var t = s; s = e; e = t; }
    l1.StartPoint = s;
    l1.EndPoint = new Point3d(EDGE, e.Y, e.Z);
    Log(string.Format("233E5 bottom rule -> ({0:F3},{1:F3}) to ({2:F3},{3:F3}) (verified)",
        l1.StartPoint.X, l1.StartPoint.Y, l1.EndPoint.X, l1.EndPoint.Y));
} else Log("233E5 not found");

// 23394: vertical right edge at x=11.215. Move it back to the sheet edge.
var l2 = getLine("23394");
if (l2 != null) {
    l2.StartPoint = new Point3d(EDGE, l2.StartPoint.Y, l2.StartPoint.Z);
    l2.EndPoint   = new Point3d(EDGE, l2.EndPoint.Y,   l2.EndPoint.Z);
    Log(string.Format("23394 right edge -> x {0:F3}, y {1:F3}..{2:F3} (verified)",
        l2.StartPoint.X, l2.StartPoint.Y, l2.EndPoint.Y));
} else Log("23394 not found");

// final sanity: nothing in the block should sit right of the sheet edge
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var btr = (BlockTableRecord)Tx.GetObject(bt["SS_BLOCK_11X17"], OpenMode.ForRead);
double xmax = -1e30; string worst = "";
foreach (ObjectId id in btr) {
    var ent = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (ent == null || ent is Viewport) continue;
    double x;
    var ad = ent as AttributeDefinition;
    if (ad != null) x = ad.Position.X;
    else { try { x = ent.GeometricExtents.MaxPoint.X; } catch { continue; } }
    if (x > xmax) { xmax = x; worst = ent.Handle.ToString(); }
}
Log(string.Format("rightmost entity now x={0:F3} [{1}]  (sheet edge 0.000)", xmax, worst));
Ed.Regen();

Result

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

Log

233E5 bottom rule -> (-10.200,13.546) to (-0.043,13.546) (verified)
23394 right edge -> x -0.043, y 13.546..15.324 (verified)
rightmost entity now x=0.000 [23396]  (sheet edge 0.000)

Notes

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

No notes yet.