C3D-0061 · READ-ONLY: what remains on layer 0 [LAYER0-LEFT] done
Groups every CogoPoint still on layer 0 by exact description with counts and point numbers, and lists any non-point entity left on 0. No changes.
C# payload
// READ-ONLY. What is still on layer 0 after the sewer and water moves.
// CogoPoints grouped by exact description with counts and point numbers, plus any non-point
// entity left on 0. 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 byDesc = new Dictionary<string, List<uint>>();
int npts = 0;
var other = new Dictionary<string,int>();
foreach (ObjectId id in ms) {
Autodesk.AutoCAD.DatabaseServices.DBObject o;
try { o = Tx.GetObject(id, OpenMode.ForRead); } catch { continue; }
var ent = o as Autodesk.AutoCAD.DatabaseServices.Entity;
if (ent == null || safe(() => ent.Layer) != "0") continue;
var cp = o as CogoPoint;
if (cp == null) {
string tn = o.GetType().Name;
if (!other.ContainsKey(tn)) other[tn] = 0;
other[tn]++;
continue;
}
npts++;
string d = (safe(() => cp.RawDescription ?? "")).Trim().ToUpper();
if (d.Length == 0) d = "<blank>";
if (!byDesc.ContainsKey(d)) byDesc[d] = new List<uint>();
byDesc[d].Add(cp.PointNumber);
}
var descs = new List<string>(byDesc.Keys);
descs.Sort();
Log("=== LAYER 0: " + npts + " CogoPoints, " + descs.Count + " distinct descriptions ===");
foreach (var d in descs) {
var ns = byDesc[d];
ns.Sort();
var shown = new List<string>();
for (int i = 0; i < ns.Count && i < 8; i++) shown.Add(ns[i].ToString());
string tail = ns.Count > 8 ? " +" + (ns.Count - 8) + " more" : "";
Log(String.Format(" {0,-40} n={1,-4} {2}{3}", d, ns.Count, String.Join(",", shown), tail));
}
Log("");
Log("=== LAYER 0: non-point entities ===");
if (other.Count == 0) Log(" none");
foreach (var kv in other) Log(" " + kv.Key + " : " + kv.Value);
Result
Log
=== LAYER 0: 494 CogoPoints, 93 distinct descriptions === <blank> n=1 1135 18 CON PIPEINV 6.1 TO TOP OF BOX n=1 1090 2 IN PVC LINE n=1 1133 24IN RIDGED INV 9.42 WITH SILT n=1 1104 24IN RIDGED PIPE INV TO 18 PIPE INV 5.3 BOT 11.1 n=1 1102 40EASEMENT n=2 5,13 6 IN BOL n=19 224,225,226,233,234,244,245,246 +11 more 6 IN PVC STUB n=1 1132 AC n=5 394,395,396,397,1098 BLDG COR SW n=4 297,300,301,402 BLDG COR CON TBC START n=1 302 BOX COR n=3 1091,1092,1093 CL n=20 132,139,145,154,158,164,172,476 +12 more CL YELLOW LINE SPLITS n=1 494 CLEAN OUT n=5 360,361,370,374,398 CON n=3 189,190,191 CON COR CANOPY n=2 202,203 CON EP n=9 287,293,294,295,296,303,304,305 +1 more CON EP CANOPY n=2 285,286 CON PAD n=8 372,442,443,444,445,446,451,452 CON PAD VAULT n=1 441 CON VAC\AIR n=1 192 CURB CUT BACK CON GUTTER n=5 322,323,324,325,326 DI n=7 204,213,306,342,346,391,433 DI 18 CON PIPE INV 4.73 n=1 1107 DI 18 METAL PIPE INV 3.73 n=1 1109 DI 18 METAL PIPE INV 3.95 n=1 1108 DI 18 PIPE INV 3.4 n=1 1110 DI 2FT ROUND INV 10.11 n=1 1139 DI INV BOT 5.08 18 CON PIPE n=1 1082 DUMP STER COR n=3 368,373,376 DUMPSTER COR TBC n=1 362 ELEC POWERBMETER AND STUT OFF n=1 393 ELEC STUB n=4 195,200,201,392 END CON n=2 308,321 EP n=37 127,128,130,141,142,156,205,206 +29 more EP CON n=2 221,307 EP CON COR n=4 179,180,181,182 EP DUMPSTER WALL n=1 367 EP TBC n=1 1049 G RAIL n=4 143,166,167,168 G WIRE n=5 411,453,454,456,460 GREASE TRAP n=5 354,355,359,1100,1101 GREASE TRAP 6 PVC 6.52 INV 7.77 n=1 1096 GREASE TRAP ASPHALT OVER n=1 1097 GUTTER n=3 1077,1078,1079 GUTTER END TBC n=1 1080 H CAP SIGN n=2 248,255 HANDY CAP n=2 240,276 HC07-05 n=1 676 HC07-06 n=1 675 IPF n=5 668,669,670,671,672 LAT n=1 407 OHP n=3 466,479,515 P STRIPE n=9 222,227,228,229,230,236,237,238 +1 more P STRIPE CON EP n=8 277,278,279,280,281,282,283,284 P STRIPE SW n=7 223,231,232,235,241,242,243 PP n=1 461 PP AND ELECT STUB n=1 410 R/W n=3 129,505,536 RAMP n=4 252,253,266,267 SIGN n=1 193 SW n=6 196,197,315,316,317,375 SW P STRIPE n=8 268,269,270,271,272,273,274,275 SW BLDG LINE n=1 318 SW COR n=2 298,299 SW END n=2 198,199 SW RAMP n=4 250,251,264,265 SW TBC COR n=1 357 TBC n=152 100,103,104,105,106,107,108,109 +144 more TBC COR n=1 194 TBC DUMP WALL n=1 366 TBC DWY n=2 421,422 TBC END n=2 516,1076 TBC END EP n=4 126,209,404,416 TBC EP n=2 464,472 TBC SW n=3 215,314,401 TBC SW COR n=2 216,217 TBC SW CROSS WALK n=2 175,176 TBC WALL n=4 412,413,414,415 TBM n=1 678 TURN LANE n=6 133,138,146,153,163,171 TURNING LANE n=3 1006,1011,1022 UTIL POLE n=1 462 VAULT n=4 447,448,449,450 VAULT COR n=6 1118,1120,1121,1126,1127,1128 WATER n=1 1085 WATER VAULT n=2 1119,1129 WHITE LINE n=14 131,140,144,155,165,169,170,475 +6 more WHITE LINE END n=1 1046 WHITE LINE ENDS n=1 157 WHITE LINE TURNING LANE n=2 1035,1040 YELLOW LINE n=18 134,137,150,159,162,488,489,497 +10 more === LAYER 0: non-point entities === PdfReference : 1
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.