C3D-0054 · READ-ONLY: re-check every manhole point and its layer [MH-RECHECK] error
Lists every CogoPoint whose description mentions MH/SSMH/MANHOLE individually with point number, description, layer, style and coordinates, plus a per-layer tally. No changes.
C# payload
// READ-ONLY. Re-check every manhole point after the user's edits.
//
// Anything whose description mentions MH / SSMH / MANHOLE, listed individually with point number,
// description, layer, style and coordinates - so a wrong layer is visible per point rather than
// only per description group. Nothing is modified.
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);
Func<Func<string>, string> safe = f => { try { return f(); } catch (System.Exception ex) { return "<" + ex.GetType().Name + ">"; } };
var rows = new List<string>();
var byLayer = new Dictionary<string,int>();
int n = 0;
foreach (ObjectId id in ms) {
CogoPoint cp = null;
try { cp = Tx.GetObject(id, OpenMode.ForRead) as CogoPoint; } catch { continue; }
if (cp == null) continue;
string d = safe(() => (cp.RawDescription ?? "")).Trim();
string u = d.ToUpper();
if (u.IndexOf("MH") < 0 && u.IndexOf("MANHOLE") < 0) continue;
n++;
string lay = safe(() => cp.Layer);
if (!byLayer.ContainsKey(lay)) byLayer[lay] = 0;
byLayer[lay]++;
rows.Add(String.Format(" pt {0,-6} {1,-22} layer={2,-24} style={3,-18} {4}",
safe(() => cp.PointNumber.ToString()),
d,
lay,
safe(() => cp.StyleName),
safe(() => String.Format("{0:F2},{1:F2}", cp.Easting, cp.Northing))));
}
rows.Sort();
Log("=== ALL MANHOLE POINTS (" + n + ") ===");
foreach (var r in rows) Log(r);
Log("");
Log("=== by layer ===");
foreach (var kv in byLayer) Log(" " + kv.Key + " : " + kv.Value);
Result
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.