← Inbox

C3DO-0868 · 261103: POB note - 521.43' TO R/W OF FLIPPEN ROAD [C3D-POBFLIPPEN2] done

Adds MText '521.43' TO R/W / OF FLIPPEN ROAD' (362.58 + 158.85) at the POB (pt 532), along the N72-33-28E line, just below it. C-ANNO, SIMPLEX 3. Skips if a FLIPPEN note exists.

Script file
C3DO-0868.cs
Target
261103 - 0 WALT STEPHENS RD.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

string F(double v)=>v.ToString("0.###");
var bt=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
var ms=(BlockTableRecord)Tx.GetObject(bt[BlockTableRecord.ModelSpace],OpenMode.ForWrite);
foreach(ObjectId id in ms){ var o=Tx.GetObject(id,OpenMode.ForRead) as MText; if(o!=null && o.Contents.Contains("FLIPPEN")){ Log("already there "+o.Handle+" - nothing done"); return; } }
// POB = point 532; boundary call from POB N72d33'28"E 158.85' (label rotation 17.442)
Point3d pob=Point3d.Origin;
foreach(ObjectId pid in CivilDoc.CogoPoints){ var cp=(Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(pid,OpenMode.ForRead); if(cp.PointNumber==532) pob=new Point3d(cp.Easting,cp.Northing,0); }
if(pob==Point3d.Origin){ Log("POB point 532 not found - nothing done"); return; }
double a=(90-(72+33/60.0+28/3600.0))*Math.PI/180;
var u=new Vector3d(Math.Cos(a),Math.Sin(a),0); var n=new Vector3d(Math.Sin(a),-Math.Cos(a),0);
var ts=(TextStyleTable)Tx.GetObject(Db.TextStyleTableId,OpenMode.ForRead);
var m=new MText(); m.SetDatabaseDefaults(Db); m.Layer="C-ANNO";
m.TextStyleId=ts.Has("SIMPLEX")?ts["SIMPLEX"]:Db.Textstyle; m.TextHeight=3; m.Rotation=a;
m.Attachment=AttachmentPoint.TopLeft; m.Location=pob+u*8+n*1.5;
m.Contents="521.43' TO R/W\\POF FLIPPEN ROAD";
ms.AppendEntity(m); Tx.AddNewlyCreatedDBObject(m,true);
Log("added "+m.Handle+" at "+F(m.Location.X)+","+F(m.Location.Y)+" rot "+F(a*180/Math.PI)+" | "+m.Contents+" (362.58 + 158.85 = 521.43)");
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\261103 - Ahmed J Ahmed Real Estate Company LLC\261103 - 0 WALT STEPHENS RD.dwg
Message
Executed C3DO-0868 (0 entities touched).
Entities
—
Duration
551 ms
Civil 3D
25.0.0.0

Log

added 224C3 at 2271919.352,1283569.746 rot 17.442 | 521.43' TO R/W\POF FLIPPEN ROAD (362.58 + 158.85 = 521.43)

Notes

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

No notes yet.