C3D-MHCHK · Check for unsymbolized manholes (read-only) done
Compare SSMH-coded points against drawn SEWER_MANHOLE circles
C# payload
// Read-only: every SSMH-coded COGO point vs the drawn SEWER_MANHOLE circles.
// HCWA requires each manhole symbolized consistently, centered on the tangent endpoints.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var ms = (BlockTableRecord)Tx.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);
var circles = new List<Point2d>();
foreach (ObjectId id in ms) { var o = Tx.GetObject(id, OpenMode.ForRead);
if (o is Circle c && c.Layer == "SEWER_MANHOLE") circles.Add(new Point2d(c.Center.X, c.Center.Y)); }
var ssmh = new List<(uint num, string code, Point2d p)>();
foreach (ObjectId id in CivilDoc.CogoPoints) {
var cp = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForRead);
var u = (cp.RawDescription ?? "").Trim();
if (u.ToUpperInvariant().Contains("SSMH")) ssmh.Add((cp.PointNumber, u, new Point2d(cp.Easting, cp.Northing)));
}
Log($"SSMH-coded points: {ssmh.Count} drawn SEWER_MANHOLE circles: {circles.Count}");
int missing = 0;
foreach (var s in ssmh.OrderBy(x => x.num)) {
double bd = double.MaxValue;
foreach (var c in circles) { double d = s.p.GetDistanceTo(c); if (d < bd) bd = d; }
string flag = bd > 1.0 ? " <== NO SYMBOL DRAWN" : "";
if (bd > 1.0) missing++;
Log($" #{s.num,-5} '{s.code,-22}' E={s.p.X:F2} N={s.p.Y:F2} nearestCircle={bd:F2}'{flag}");
}
Log($"MANHOLES WITHOUT A DRAWN SYMBOL: {missing}");
Result
Log
SSMH-coded points: 10 drawn SEWER_MANHOLE circles: 8 #101 'SSMH MD 21.95 ' E=2296877.74 N=1280034.32 nearestCircle=79.75' <== NO SYMBOL DRAWN #102 'SSMH MD 13.96 WATER ' E=2296981.39 N=1279913.29 nearestCircle=239.09' <== NO SYMBOL DRAWN #806 'SSMH MD 10.3 ' E=2296827.27 N=1280096.07 nearestCircle=0.00' #809 'SSMH INV 12.65 ' E=2296714.14 N=1280025.06 nearestCircle=0.00' #810 'SSMH INV 10.28 ' E=2296691.10 N=1280045.90 nearestCircle=0.00' #812 'SSMH ' E=2296604.89 N=1280046.15 nearestCircle=0.00' #814 'SSMH INV 12.22 ' E=2296511.06 N=1279951.56 nearestCircle=0.00' #816 'SSMH ' E=2296379.89 N=1279953.45 nearestCircle=0.00' #1095 'SSMH INV 9.45 ' E=2296685.40 N=1280052.25 nearestCircle=0.00' #1111 'SSMH ' E=2296652.15 N=1280058.09 nearestCircle=0.00' MANHOLES WITHOUT A DRAWN SYMBOL: 2
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.