← Inbox

C3D-0679 · 261009 R1 follow-up: curve table + C1 tag, easement / MH label moves [C3D-R1FIX] done

From reading the R1 plot: curve data moved off the cul-de-sac into a CURVE TABLE (paper, both 11X17 layouts, on a wipeout) with a C1 tag at the arc (replaced DELTA/CH texts moved to frozen C-PROP-LINE-TEXT-R0). S.S.E. and drainage-easement labels re-placed by an overlap test; MH SMJC2115280 label moved off the road name.

Script file
C3D-0679.cs
Target
261009 - 510 Covington Cove.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForRead);
if(lt.Has("C-PROP-LINE-TEXT-R0")){ Log("SKIP - R1 fix pass already run"); return; }
lt.UpgradeOpen(); var r0=new LayerTableRecord{Name="C-PROP-LINE-TEXT-R0",IsFrozen=true}; lt.Add(r0); Tx.AddNewlyCreatedDBObject(r0,true); Log("layer C-PROP-LINE-TEXT-R0 FROZEN");
string BS=((char)92).ToString(); string P=BS+"P"; string DEG=BS+"U+00B0";
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForRead);
foreach(ObjectId id in ms){ var t=Tx.GetObject(id,OpenMode.ForRead) as DBText; if(t==null) continue;
 Action<double,double,double> mv=(x,y,r)=>{ t.UpgradeOpen(); t.AlignmentPoint=new Point3d(x,y,0); t.Rotation=r; t.AdjustAlignment(Db); };
 if(t.Layer=="C-ESMT-SSWR"&&t.TextString.StartsWith("20' S.S.E.")){ mv(2276542.6969,1456195.1898,1.184696); Log("moved S.S.E. label"); }
 else if(t.Layer=="X-ESMT-STRM"&&t.TextString.StartsWith("20' DRAINAGE")){ mv(2276460.3704,1456375.5175,0.735833); Log("moved drainage easement label"); }
 else if(t.Layer=="C-PROP-LINE-TEXT"&&t.TextString.StartsWith("R=50.00'")){ t.UpgradeOpen(); t.TextString="C1"; t.Height=3.0; t.AlignmentPoint=new Point3d(2276510.9700,1456408.7034,0); t.Rotation=0; t.AdjustAlignment(Db); Log("curve tag C1 at the arc"); }
 else if(t.Layer=="C-PROP-LINE-TEXT"&&(t.TextString.StartsWith("DELTA=")||t.TextString.StartsWith("CH=49.96'"))){ t.UpgradeOpen(); t.Layer="C-PROP-LINE-TEXT-R0"; Log("curve text '"+t.TextString+"' -> C-PROP-LINE-TEXT-R0 (now in the curve table)"); }
 else if(t.Layer=="SS-SEWER LINE"&&t.TextString.StartsWith("MH SMJC2115280")){ mv(2276492.7000,1456447.7000,0); Log("moved MH SMJC2115280 label off the road name"); }
}
var tst=(TextStyleTable)Tx.GetObject(Db.TextStyleTableId,OpenMode.ForRead); var sty=tst.Has("Standard")?tst["Standard"]:Db.Textstyle;
string ct="CURVE TABLE"+P+"C1   R=50.00'   L=52.31'"+P+"DELTA=59"+DEG+"56'36\""+P+"CH=49.96'   CB=N68"+DEG+"58'14\"W";
var ld=(DBDictionary)Tx.GetObject(Db.LayoutDictionaryId,OpenMode.ForRead);
foreach(DBDictionaryEntry de in ld){ var lo=(Layout)Tx.GetObject(de.Value,OpenMode.ForRead); if(lo.LayoutName!="11X17"&&lo.LayoutName!="11X17 DEMO") continue;
 var btr=(BlockTableRecord)Tx.GetObject(lo.BlockTableRecordId,OpenMode.ForWrite);
 var w=new Wipeout(); w.SetDatabaseDefaults(); w.SetFrom(new Point2dCollection{new Point2d(8.50,15.20),new Point2d(10.12,15.20),new Point2d(10.12,15.82),new Point2d(8.50,15.82),new Point2d(8.50,15.20)},Vector3d.ZAxis); w.Layer="BLOCK_CLOSURE"; btr.AppendEntity(w); Tx.AddNewlyCreatedDBObject(w,true);
 var m=new MText(); m.SetDatabaseDefaults(); m.Layer="C-PROP-LINE-TEXT"; m.TextStyleId=sty; m.TextHeight=0.065; m.Width=1.55; m.Attachment=AttachmentPoint.TopLeft; m.Location=new Point3d(8.55,15.78,0); m.Contents=ct; btr.AppendEntity(m); Tx.AddNewlyCreatedDBObject(m,true);
 var dot=(DrawOrderTable)Tx.GetObject(btr.DrawOrderTableId,OpenMode.ForWrite); dot.MoveToTop(new ObjectIdCollection{m.ObjectId});
 Log(lo.LayoutName+": curve table placed (8.55,15.78) on a wipeout"); }
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\261009 - 510 Covington Cove, Byron, GA 31008, USA\261009 - 510 Covington Cove.dwg
Message
Executed C3D-0679 (0 entities touched).
Entities
—
Duration
432 ms
Civil 3D
25.0.0.0

Log

layer C-PROP-LINE-TEXT-R0 FROZEN
moved MH SMJC2115280 label off the road name
curve tag C1 at the arc
curve text 'DELTA=59%%d56'36"' -> C-PROP-LINE-TEXT-R0 (now in the curve table)
curve text 'CH=49.96'  CB=N68%%d58'14"W' -> C-PROP-LINE-TEXT-R0 (now in the curve table)
moved S.S.E. label
moved drainage easement label
11X17: curve table placed (8.55,15.78) on a wipeout
11X17 DEMO: curve table placed (8.55,15.78) on a wipeout

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.