← Inbox

C3D-FCPTS · FC fence-corner points + distances (read-only) done

Locate the 4 FC points and their pairwise distances to determine the fence run(s)

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

C# payload

// Read-only: the 4 FC (fence corner) points with number + coords, ordered by point number,
// so we can see the actual geometry and figure out which points form which fence run (Rule 9).
var cd = CivilDoc; var cps = cd.CogoPoints;
var hits = new List<(uint num, string raw, double e, double n)>();
foreach (ObjectId id in cps) {
    var cp = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForRead);
    var raw = (cp.RawDescription ?? "").Trim();
    if (raw.ToUpperInvariant().Contains("FC"))
        hits.Add((cp.PointNumber, raw, cp.Easting, cp.Northing));
}
foreach (var h in hits.OrderBy(x => x.num))
    Log($"#{h.num}  '{h.raw}'  E={h.e:F2} N={h.n:F2}");
// pairwise distances so we can see which are close enough to be a real run
var arr = hits.OrderBy(x => x.num).ToList();
Log("--- pairwise distances (ft) ---");
for (int i = 0; i < arr.Count; i++)
    for (int j = i+1; j < arr.Count; j++) {
        double d = System.Math.Sqrt(System.Math.Pow(arr[i].e-arr[j].e,2)+System.Math.Pow(arr[i].n-arr[j].n,2));
        Log($"  #{arr[i].num} -> #{arr[j].num}: {d:F1}'");
    }
Log($"FC points: {hits.Count}");

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-FCPTS (0 entities touched).
Entities
Duration
338 ms
Civil 3D
25.0.0.0

Log

#137  'IPF 1\2 RBF FC FL'  E=2225443.14 N=1346018.10
#167  'FLAGED FC'  E=2225237.38 N=1346045.68
#169  'OLD FLAGED FC'  E=2225150.14 N=1346026.56
#173  'FC FL'  E=2225321.66 N=1346132.31
--- pairwise distances (ft) ---
  #137 -> #167: 207.6'
  #137 -> #169: 293.1'
  #137 -> #173: 166.7'
  #167 -> #169: 89.3'
  #167 -> #173: 120.9'
  #169 -> #173: 201.5'
FC points: 4

Notes

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

No notes yet.