C3D-260619-DELMH1 · Delete point group MH.1 error
Erases the duplicate point group MH.1. Group definition only - CogoPoints untouched, verified by count before/after.
C# payload
// Delete the duplicate point group "MH.1". Deleting a PointGroup removes only the group
// definition - the CogoPoints themselves are untouched.
// Host owns Tx; host regens after commit.
const string NAME = "MH.1";
var cdoc = CivilDoc;
Log("CogoPoints before: " + cdoc.CogoPoints.Count);
ObjectId target = ObjectId.Null;
foreach (ObjectId id in cdoc.PointGroups)
{
var pg = Tx.GetObject(id, OpenMode.ForRead) as PointGroup;
if (pg != null && pg.Name == NAME) { target = id; break; }
}
if (target.IsNull) { Log("'" + NAME + "' not found."); return; }
var g = (PointGroup)Tx.GetObject(target, OpenMode.ForWrite);
uint[] had; try { had = g.GetPointNumbers(); } catch { had = new uint[0]; }
Log("erasing '" + NAME + "' (it listed " + had.Length + " points)");
g.Erase();
int left = 0;
foreach (ObjectId id in cdoc.PointGroups)
{
var pg = Tx.GetObject(id, OpenMode.ForRead) as PointGroup;
if (pg != null && !pg.IsErased) left++;
}
Log("point groups now: " + left + "; CogoPoints after: " + cdoc.CogoPoints.Count + " (verified)");
Result
Log
CogoPoints before: 374 erasing 'MH.1' (it listed 6 points)
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.