C3D-0613 · DI points: short descriptions + separate notes done
Set the 9 storm point descriptions to their structure names (DI A4..DI-RISER B1, OCS C3, per the 260613 field redline) and put the rim/invert/pipe data in a separate MText note beside each point on new layer V-STORM-TEXT.
C# payload
string LAY="V-STORM-TEXT"; string P=((char)92).ToString()+"P";
var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForRead);
if(!lt.Has(LAY)){ lt.UpgradeOpen(); var l=new LayerTableRecord{Name=LAY,Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,3)}; lt.Add(l); Tx.AddNewlyCreatedDBObject(l,true); Log("created layer "+LAY); }
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForWrite);
var hs=new List<double>(); var existing=new List<Point3d>();
foreach(ObjectId id in ms){ var m=Tx.GetObject(id,OpenMode.ForRead) as MText; if(m==null) continue; hs.Add(m.TextHeight); if(m.Layer==LAY) existing.Add(m.Location); }
hs.Sort(); double H=hs.Count>0?hs[hs.Count/2]:2.5; Log("note height = median model MText height "+H.ToString("F2")+" (n="+hs.Count+")");
var R=new List<object[]>();
R.Add(new object[]{1109,"DI A4",new string[]{"RIM 729.21","INV 725.48","18\" METAL"}});
R.Add(new object[]{1108,"DI A3",new string[]{"RIM 728.30","INV 724.35","18\" METAL"}});
R.Add(new object[]{1107,"DI A2",new string[]{"RIM 727.60","INV 722.87","18\" CONC"}});
R.Add(new object[]{1139,"DI-RISER A1",new string[]{"RIM 727.31","INV 717.20","2' ROUND"}});
R.Add(new object[]{1110,"DI B4",new string[]{"RIM 727.51","INV 724.11","18\""}});
R.Add(new object[]{1082,"DI B3",new string[]{"RIM 727.53","INV 722.45","18\" CONC"}});
R.Add(new object[]{346,"DI B2",new string[]{"RIM 726.61","INV 720.51","18\" CONC"}});
R.Add(new object[]{1102,"DI-RISER B1",new string[]{"RIM 727.67","INV 722.37 (18\")","BOT 716.57 (24\" RIDGED)"}});
R.Add(new object[]{1104,"OCS C3",new string[]{"RIM 726.13","INV 716.71","24\" RIDGED"}});
var byNum=new Dictionary<uint,ObjectId>();
foreach(ObjectId id in CivilDoc.CogoPoints){ var p=(CogoPoint)Tx.GetObject(id,OpenMode.ForRead); byNum[p.PointNumber]=id; }
foreach(var r in R){
uint num=(uint)(int)r[0]; string d=(string)r[1]; var lines=(string[])r[2];
if(!byNum.ContainsKey(num)){ Log(num+": point not found"); continue; }
var p=(CogoPoint)Tx.GetObject(byNum[num],OpenMode.ForWrite);
string o=p.RawDescription; p.RawDescription=d;
var loc=new Point3d(p.Easting+H,p.Northing+H,0);
bool has=existing.Any(e=>e.DistanceTo(loc)<1.0);
if(!has){ var m=new MText(); m.SetDatabaseDefaults(); m.Layer=LAY; m.TextHeight=H; m.Attachment=AttachmentPoint.BottomLeft; m.Location=loc; m.Contents=string.Join(P,lines); ms.AppendEntity(m); Tx.AddNewlyCreatedDBObject(m,true); }
Log(num+": desc '"+o+"' -> '"+p.RawDescription+"'"+(p.RawDescription==d?" (verified)":" MISMATCH")+(has?" | note exists, skipped":" | note: "+string.Join(" / ",lines)));
}
Ed.Regen();
Result
Log
created layer V-STORM-TEXT note height = median model MText height 3.00 (n=80) 1109: desc 'DI 18 METAL PIPE INV 3.73' -> 'DI A4' (verified) | note: RIM 729.21 / INV 725.48 / 18" METAL 1108: desc 'DI 18 METAL PIPE INV 3.95' -> 'DI A3' (verified) | note: RIM 728.30 / INV 724.35 / 18" METAL 1107: desc 'DI 18 CON PIPE INV 4.73' -> 'DI A2' (verified) | note: RIM 727.60 / INV 722.87 / 18" CONC 1139: desc 'DI 2FT ROUND INV 10.11' -> 'DI-RISER A1' (verified) | note: RIM 727.31 / INV 717.20 / 2' ROUND 1110: desc 'DI 18 PIPE INV 3.4' -> 'DI B4' (verified) | note: RIM 727.51 / INV 724.11 / 18" 1082: desc 'DI INV BOT 5.08 18 CON PIPE' -> 'DI B3' (verified) | note: RIM 727.53 / INV 722.45 / 18" CONC 346: desc 'DI 18 CON PIPEINV 6.1 TO TOP OF BOX' -> 'DI B2' (verified) | note: RIM 726.61 / INV 720.51 / 18" CONC 1102: desc 'DI 24IN RIDGED PIPE INV TO 18 PIPE INV 5.3 BOT 11.1' -> 'DI-RISER B1' (verified) | note: RIM 727.67 / INV 722.37 (18") / BOT 716.57 (24" RIDGED) 1104: desc 'DI 24IN RIDGED INV 9.42 WITH SILT' -> 'OCS C3' (verified) | note: RIM 726.13 / INV 716.71 / 24" RIDGED
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.