C3D-0343 · Count CP / OTP / IPF control points in the active drawing [C3D-CPCHK] done
Read-only. Walks the CogoPoint collection, counts points whose raw description starts with CP, OTP or IPF, and lists each with point number, northing, easting and elevation.
C# payload
// Count and list the CP / OTP / IPF control points as they stand right now.
var civ = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument;
Log("drawing: " + Db.Filename);
int cp=0, otp=0, ipf=0, total=0;
var rows = new List<string>();
foreach (ObjectId id in civ.CogoPoints) {
var p = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.CogoPoint;
if (p == null) continue;
total++;
string d = (p.RawDescription ?? "").Trim();
string first = d.Length == 0 ? "" : d.Split(' ')[0].ToUpper();
bool hit = false;
if (first == "CP") { cp++; hit = true; }
if (first == "OTP") { otp++; hit = true; }
if (first == "IPF") { ipf++; hit = true; }
if (hit) rows.Add(string.Format(" {0,5} {1,-8} N {2,13:F4} E {3,13:F4} Z {4,9:F3}",
p.PointNumber, first, p.Northing, p.Easting, p.Elevation));
}
rows.Sort();
foreach (var r in rows) Log(r);
Log("");
Log(string.Format("CP {0} OTP {1} IPF {2} = {3} (of {4} points total)",
cp, otp, ipf, cp+otp+ipf, total));
Result
Log
drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd R2.dwg
364 IPF N 1207312.9316 E 2206379.5725 Z 854.295
406 OTP N 1207293.5077 E 2203443.1704 Z 823.301
500 IPF N 1207293.3588 E 2203443.1687 Z 823.243
510 IPF N 1206809.8163 E 2203438.7211 Z 837.370
520 IPF N 1206709.9971 E 2203439.2944 Z 854.290
521 IPF N 1206719.6631 E 2205253.5086 Z 854.290
522 IPF N 1206798.9689 E 2205255.8347 Z 854.290
523 IPF N 1206809.1899 E 2206344.7867 Z 854.290
524 CP N 1206809.4208 E 2206364.7110 Z 854.295
525 IPF N 1206717.3657 E 2204844.8382 Z 854.290
526 IPF N 1206967.3546 E 2204842.4917 Z 854.290
527 IPF N 1206969.7050 E 2205260.7851 Z 854.290
528 IPF N 1206948.9038 E 2205260.1811 Z 854.290
529 CP N 1206959.1267 E 2206349.1408 Z 854.290
531 IPF N 1206959.1830 E 2206355.1445 Z 854.290
535 CP N 1206959.3160 E 2206369.3074 Z 854.290
CP 3 OTP 1 IPF 12 = 16 (of 164 points total)Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.