C3D-RD508 · Read pt 508 + compute endpoint (read-only) done
Get COGO 508 E/N and the S83°36'43"E 75.23' endpoint for C3D-23.
C# payload
// READ-ONLY: get COGO point #508 easting/northing + compute the S83°36'43"E 75.23' endpoint.
using System;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.Civil.ApplicationServices;
using Autodesk.Civil.DatabaseServices;
var db = Db;
var cdoc = CivilDocument.GetCivilDocument(db);
using (var tr = db.TransactionManager.StartTransaction())
{
bool found=false;
foreach (ObjectId id in cdoc.CogoPoints)
{
var cp = tr.GetObject(id, OpenMode.ForRead) as CogoPoint;
if (cp == null) continue;
if ((int)cp.PointNumber == 508)
{
double e=cp.Easting, n=cp.Northing;
// bearing S 83°36'43" E: azimuth from north = 180 - (83 + 36/60 + 43/3600)
double q = 83 + 36/60.0 + 43/3600.0;
double az = 180.0 - q; // S..E quadrant
double azr = az * Math.PI/180.0;
double dist = 75.23;
double ex = e + dist*Math.Sin(azr);
double ny = n + dist*Math.Cos(azr);
Log($"PT 508: E={e:0.000} N={n:0.000} desc='{cp.RawDescription}'");
Log($"CALL S83°36'43\"E 75.23' -> az={az:0.0000}deg");
Log($"ENDPOINT: E={ex:0.000} N={ny:0.000}");
found=true;
break;
}
}
if(!found) Log("PT 508 NOT FOUND");
tr.Commit();
}
Result
Log
PT 508: E=2166393.496 N=1330090.878 desc='IPF' CALL S83°36'43"E 75.23' -> az=96.3881deg ENDPOINT: E=2166468.259 N=1330082.507
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.