← Inbox

C3D-0511 · Curved CHRISTMAS AVE label following road arc 812 [C3D-0512] error

Replace straight label with per-character DBText along the frontage arc (R=1930, bulge 0.046) on V-ROAD-TEXT.

Script file
C3D-0511.cs
Target
812 Christmas Ave.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload


var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForWrite);
if(!lt.Has("V-ROAD-TEXT")){ var l=new LayerTableRecord{Name="V-ROAD-TEXT",Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,3)}; lt.Add(l); Tx.AddNewlyCreatedDBObject(l,true); }
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForWrite);
// remove earlier straight label 22A47
Handle oh=new Handle(Convert.ToInt64("22A47",16)); ObjectId oid;
if(Db.TryGetObjectId(oh,out oid)&&!oid.IsNull){ var oe=(Autodesk.AutoCAD.DatabaseServices.Entity)Tx.GetObject(oid,OpenMode.ForWrite); oe.Erase(); Log("erased straight label 22A47"); }
int n=0;
System.Action<string,double,double,double> addc=(ch,x,y,rot)=>{ var t=new DBText(); t.TextString=ch; t.Height=9.0; t.Rotation=rot; t.HorizontalMode=TextHorizontalMode.TextMid; t.VerticalMode=TextVerticalMode.TextVerticalMid; t.Position=new Point3d(x,y,0); t.AlignmentPoint=new Point3d(x,y,0); t.Layer="V-ROAD-TEXT"; ms.AppendEntity(t); Tx.AddNewlyCreatedDBObject(t,true); n++; };
addc("C",2433961.580400,1429409.558700,1.3564524413574728);
addc("H",2433962.948200,1429415.892700,1.359803473521302);
addc("R",2433964.294600,1429422.231200,1.363154505685131);
addc("I",2433965.619800,1429428.574300,1.3665229911414805);
addc("S",2433966.923700,1429434.921800,1.3698740233053093);
addc("T",2433968.206200,1429441.273600,1.3732250554691385);
addc("M",2433969.467500,1429447.629600,1.3765935409254877);
addc("A",2433970.707400,1429453.989900,1.3799445730893165);
addc("S",2433971.925900,1429460.354300,1.3832956052531458);
addc("A",2433974.298800,1429473.095200,1.3900151228733237);
addc("V",2433975.453200,1429479.471500,1.3933661550371532);
addc("E",2433976.586200,1429485.851700,1.3967346404935022);
addc("(",2433978.787900,1429498.623300,1.4034367048211605);
addc("1",2433979.856500,1429505.014600,1.4068051902775094);
addc("0",2433980.903700,1429511.409400,1.4101562224413384);
addc("0",2433981.929500,1429517.807700,1.4135072546051677);
addc("'",2433982.933700,1429524.209400,1.4168757400615166);
addc("R",2433984.877700,1429537.022700,1.4235778043891747);
addc("/",2433985.817400,1429543.434200,1.4269462898455236);
addc("W",2433986.735600,1429549.848900,1.430297322009353);
addc(")",2433987.632300,1429556.266500,1.4336483541731821);
Log("placed "+n+" curved chars on V-ROAD-TEXT");
Ed.Regen();

Result

Status
error
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260903 - 812 Christmas Ave, Bethlehem, GA 30620, USA\812 Christmas Ave.dwg
Message
eWasErased
Entities
—
Duration
600 ms
Civil 3D
25.0.0.0

Notes

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

No notes yet.