C3DO-0795 · 261101 ALTA 4b/7: fix side-of-line wording on 4 labels from C3DO-0794 [C3D-A4FIX] done
Corrects labels added by C3DO-0794: steps/walk run 0.2 N to 16.3 S; NW wall end is 1.8 W of the line (in R/W), not E; SE wall crosses the line up to 2.3 N; fence and wall labels at the east parking were stacked - merged into one WALL W/ FENCE label (the duplicate label I added is removed).
C# payload
string F(double v)=>v.ToString("0.###");
ObjectId H(string h)=>Db.GetObjectId(false,new Handle(Convert.ToInt64(h,16)),0);
ObjectId Lyr(string name,short c){ var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForRead); if(lt.Has(name)) return lt[name]; lt.UpgradeOpen(); var r=new LayerTableRecord{Name=name,Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,c)}; var id=lt.Add(r); Tx.AddNewlyCreatedDBObject(r,true); Log("layer created "+name); return id; }
ObjectId Put(BlockTableRecord btr, Autodesk.AutoCAD.DatabaseServices.Entity e, string layer){ e.SetDatabaseDefaults(Db); e.Layer=layer; var id=btr.AppendEntity(e); Tx.AddNewlyCreatedDBObject(e,true); return id; }
var LM=LayoutManager.Current;
BlockTableRecord PS(string name){ var l=(Layout)Tx.GetObject(LM.GetLayoutId(name),OpenMode.ForRead); return (BlockTableRecord)Tx.GetObject(l.BlockTableRecordId,OpenMode.ForWrite); }
var BT=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
var MS=(BlockTableRecord)Tx.GetObject(BT[BlockTableRecord.ModelSpace],OpenMode.ForWrite);
bool HasText(BlockTableRecord btr,string contains){ foreach(ObjectId id in btr){ var o=Tx.GetObject(id,OpenMode.ForRead); if(o is MText m && m.Contents.Contains(contains)) return true; if(o is DBText t && t.TextString.Contains(contains)) return true; } return false; }
var fix=new Dictionary<string,string>{
{@"CONC. STEPS & WALK (FMLS)\P0.2'-16.3' S OF LINE", @"CONC. STEPS & WALK (FMLS)\P0.2' N TO 16.3' S OF LINE"},
{"WALL 1.8' E OF LINE", "WALL END 1.8' W OF LINE (IN R/W)"},
{"WALL 46.2'-55.0' W OF LINE", "WALL W/ FENCE 46.2'-57.0' W OF LINE"},
{"WALL CORNER 2.3' N OF LINE", "WALL CROSSES LINE, UP TO 2.3' N OF LINE"} };
var ids=new List<ObjectId>(); foreach(ObjectId id in MS) ids.Add(id);
foreach(var id in ids){ var m=Tx.GetObject(id,OpenMode.ForRead) as MText; if(m==null) continue;
if(fix.TryGetValue(m.Contents,out var nw)){ m.UpgradeOpen(); string o=m.Contents; m.Contents=nw; Log("\""+o+"\" -> \""+m.Contents+"\" (verified) "+id.Handle); }
else if(m.Contents=="FENCE 46.2'-57.0' W OF LINE"){ m.UpgradeOpen(); m.Erase(); Log("erased duplicate label I added in C3DO-0794 (fence sits on the wall; merged into the wall label) "+id.Handle); } }
Ed.Regen();
Result
Log
"CONC. STEPS & WALK (FMLS)\P0.2'-16.3' S OF LINE" -> "CONC. STEPS & WALK (FMLS)\P0.2' N TO 16.3' S OF LINE" (verified) 21DE0 "WALL CORNER 2.3' N OF LINE" -> "WALL CROSSES LINE, UP TO 2.3' N OF LINE" (verified) 21DE3 "WALL 1.8' E OF LINE" -> "WALL END 1.8' W OF LINE (IN R/W)" (verified) 21DEA erased duplicate label I added in C3DO-0794 (fence sits on the wall; merged into the wall label) 21DEC "WALL 46.2'-55.0' W OF LINE" -> "WALL W/ FENCE 46.2'-57.0' W OF LINE" (verified) 21DED
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.