C3D-ALLPTS · List all point families error
Read-only: groups all COGO points by description prefix
C# payload
// READ-ONLY: dump every CogoPoint with description, group by description prefix
using System;
using System.Linq;
using System.Collections.Generic;
using Autodesk.Civil.ApplicationServices;
using Autodesk.Civil.DatabaseServices;
using Autodesk.AutoCAD.DatabaseServices;
var db = Db;
var cdoc = CivilDocument.GetCivilDocument(db);
using (var tr = Tx) {
var pts = cdoc.CogoPoints;
var byDesc = new Dictionary<string, List<int>>();
foreach (var ptId in pts) {
var pt = tr.GetObject(ptId, OpenMode.ForRead) as CogoPoint;
if (pt == null) continue;
string desc = pt.Description ?? "";
string prefix = desc.Split()[0];
if (!byDesc.ContainsKey(prefix))
byDesc[prefix] = new List<int>();
byDesc[prefix].Add(pt.PointNumber);
}
Log($"Point families found:");
foreach (var kv in byDesc.OrderBy(x => x.Key)) {
Log($" {kv.Key:20} {kv.Value.Count:3} points #{kv.Value.Min()}-{kv.Value.Max()}");
}
}
Result
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.