← Inbox

C3D-CTRLCHK · Hunt for control/monument points (read-only) done

Search all cogo points for iron pins, monuments, control or benchmark codes to satisfy HCWA control-pin requirement

Script file
C3D-CTRLCHK.cs
Target
active document · model space
Author
claude
Approved
yes · claude (read-only inspection)
Timeout
60s

C# payload

// Read-only: hunt for anything that could serve as an HCWA control pin — iron pins, rebar,
// monuments, control/benchmark codes — across ALL cogo points, plus the SS-FRZ layer contents.
var cd = CivilDoc;
string[] key = { "IPF","IPS","RBF","REBAR","MON","CONTROL","CP","BM","BENCH","NAIL","DISK",
                 "GPS","CTP","PIN","IRON" };
var hits = new List<(uint,string,double,double,double)>();
int all = 0;
foreach (ObjectId id in cd.CogoPoints) {
    var cp = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForRead);
    all++;
    var u = (cp.RawDescription ?? "").Trim().ToUpperInvariant();
    foreach (var k in key)
        if (System.Text.RegularExpressions.Regex.IsMatch(u, @"\b" + k)) {
            hits.Add((cp.PointNumber, cp.RawDescription ?? "", cp.Easting, cp.Northing, cp.Elevation));
            break;
        }
}
Log($"total cogo points: {all}");
Log("--- control/monument candidates ---");
foreach (var h in hits.OrderBy(x => x.Item1))
    Log($"  #{h.Item1,-5} '{h.Item2,-28}' E={h.Item3:F3} N={h.Item4:F3} Z={h.Item5:F3}");
Log($"candidates: {hits.Count}");

// what lives on SS-FRZ (57 cogo points per the audit)
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var ms = (BlockTableRecord)Tx.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);
var frz = new Dictionary<string,int>();
foreach (ObjectId id in ms) {
    var o = Tx.GetObject(id, OpenMode.ForRead);
    var e = o as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (e == null || e.Layer != "SS-FRZ") continue;
    if (o is Autodesk.Civil.DatabaseServices.CogoPoint c) {
        var d = (c.RawDescription ?? "").Trim();
        frz[d] = frz.TryGetValue(d, out var n) ? n+1 : 1;
    }
}
Log("--- SS-FRZ point codes ---");
foreach (var kv in frz.OrderBy(k => k.Key)) Log($"   x{kv.Value,-3} '{kv.Key}'");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\CSTORE WATER ABS-260612_SHEET.dwg
Message
Executed C3D-CTRLCHK (0 entities touched).
Entities
Duration
559 ms
Civil 3D
25.0.0.0

Log

total cogo points: 140
--- control/monument candidates ---
candidates: 0
--- SS-FRZ point codes ---
   x3   '2 IN RPZ BFP  COR'
   x3   'BOX COR'
   x8   'CL'
   x7   'EP'
   x1   'START WHITE LINE TURN'
   x5   'TBC'
   x4   'TURNING LANE'
   x6   'VAULT COR'
   x1   'WATER'
   x1   'WATER LINE  MARK FOR NEW LINE TO BLDG'
   x7   'WHITE LINE'
   x1   'WHITE LINE END'
   x2   'WHITE LINE TURNING LANE'
   x8   'YELLOW LINE'

Notes

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

No notes yet.