C3D-0353 · READ-ONLY: why did the STAKEOUT group go from 15 points to 13? [C3D-COUNTCHK] done
Compares the STAKEOUT group's current membership against a raw scan of every CogoPoint whose description starts IPF, CP or OTP, flagging any that match the codes but are missing from the group (and vice versa). Also reports the group's IsOutOfDate flag and the total point count. Writes nothing.
C# payload
// Why did STAKEOUT go 15 -> 13? Compare the group's members against a raw scan of every
// CogoPoint whose description starts IPF / CP / OTP.
var civ = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument;
Log("drawing: " + Db.Filename);
ObjectId gid = ObjectId.Null;
foreach (ObjectId id in civ.PointGroups) {
var pg = (Autodesk.Civil.DatabaseServices.PointGroup)Tx.GetObject(id, OpenMode.ForRead);
if (pg.Name == "STAKEOUT") { gid = id; break; }
}
var grp = (Autodesk.Civil.DatabaseServices.PointGroup)Tx.GetObject(gid, OpenMode.ForRead);
var inGroup = new HashSet<uint>(grp.GetPointNumbers());
Log("group members: " + inGroup.Count + " IsOutOfDate=" + grp.IsOutOfDate);
Log("query: " + grp.GetQuery().QueryString);
Log("");
// raw scan
int total = 0;
Log("every point whose raw description starts IPF / CP / OTP:");
foreach (ObjectId id in civ.CogoPoints) {
var p = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForRead);
total++;
string d = (p.RawDescription ?? "").Trim();
string u = d.ToUpper();
if (!(u.StartsWith("IPF") || u.StartsWith("CP") || u.StartsWith("OTP"))) continue;
bool member = inGroup.Contains((uint)p.PointNumber);
Log(string.Format(" {0,5} raw=\"{1}\" full=\"{2}\" {3}",
p.PointNumber, d, (p.FullDescription ?? "").Trim(), member ? "" : " <-- NOT IN GROUP"));
}
Log("");
Log("total CogoPoints in drawing: " + total);
// and the reverse: anyone in the group who does not match
Log("");
Log("group members that do NOT start with those codes:");
foreach (ObjectId id in civ.CogoPoints) {
var p = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForRead);
if (!inGroup.Contains((uint)p.PointNumber)) continue;
string u = (p.RawDescription ?? "").Trim().ToUpper();
if (u.StartsWith("IPF") || u.StartsWith("CP") || u.StartsWith("OTP")) continue;
Log(string.Format(" {0,5} \"{1}\"", p.PointNumber, p.RawDescription));
}
Result
Log
drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd R2.dwg
group members: 13 IsOutOfDate=False
query: (RawDescription='IPF*' OR RawDescription='CP*' OR RawDescription='OTP*')
every point whose raw description starts IPF / CP / OTP:
364 raw="IPF" full="IPF"
406 raw="OTP" full="OTP"
500 raw="IPF" full="IPF"
521 raw="IPF" full="IPF"
522 raw="IPF" full="IPF"
523 raw="IPF" full="IPF"
525 raw="IPF" full="IPF"
526 raw="IPF" full="IPF"
527 raw="IPF" full="IPF"
528 raw="IPF" full="IPF"
529 raw="CP" full="CP"
2000 raw="IPF" full="IPF"
2003 raw="IPF" full="IPF"
total CogoPoints in drawing: 195
group members that do NOT start with those codes:Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.