← Inbox

C3D-FENCEREAD · Read fence points (read-only) done

Dump every fence-coded COGO point + tally the codes before drawing linework

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

C# payload

// Read-only: dump every COGO point whose description looks like a fence, so we can see how many
// there are, what codes are used, and their layout BEFORE drawing any linework (Rule 9).
var cd = CivilDoc; var cps = cd.CogoPoints;
int total = 0, fence = 0;
var seenDesc = new Dictionary<string,int>();
foreach (ObjectId id in cps) {
    var cp = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForRead);
    total++;
    var raw = (cp.RawDescription ?? "").Trim();
    var full = (cp.FullDescription ?? "").Trim();
    var u = (raw + " " + full).ToUpperInvariant();
    if (u.Contains("FEN") || u.Contains("FN") || u.Contains("FENCE") || u.Contains("CLF") || u.Contains("WF") || u.Contains("WOOD F") || u.Contains("PF")) {
        Log($"#{cp.PointNumber}  raw='{raw}'  full='{full}'  E={cp.Easting:F2} N={cp.Northing:F2} Z={cp.Elevation:F2}");
        fence++;
        var key = raw.ToUpperInvariant();
        seenDesc[key] = seenDesc.TryGetValue(key, out var n) ? n+1 : 1;
    }
}
Log("--- fence-code tally ---");
foreach (var kv in seenDesc) Log($"  '{kv.Key}' x{kv.Value}");
Log($"TOTAL points={total}  fence-like={fence}");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260702 - 358 St Johns Ave SW, Atlanta, GA 30315, USA\260702 - 358 St Johns Ave SW.dwg
Message
Executed C3D-FENCEREAD (0 entities touched).
Entities
Duration
448 ms
Civil 3D
25.0.0.0

Log

#137  raw='IPF 1\2 RBF FC FL'  full='IPF 1\2 RBF FC FL'  E=2225443.14 N=1346018.10 Z=941.34
#168  raw='IPF SQ ROD'  full='IPF SQ ROD'  E=2225195.28 N=1346002.25 Z=934.97
--- fence-code tally ---
  'IPF 1\2 RBF FC FL' x1
  'IPF SQ ROD' x1
TOTAL points=76  fence-like=2

Notes

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

No notes yet.