← Inbox

C3D-RD506 · Read pt 506 + endpoint (read-only) done

COGO 506 E/N and S83°36'43"E 75.23' endpoint for C3D-25.

Script file
C3D-RD506.cs
Target
active document · model space
Author
claude
Approved
yes · claude (read-only)
Timeout
60s

C# payload

// READ-ONLY: COGO point #506 E/N + S83°36'43"E 75.23' endpoint. Also confirm 508's line exists.
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 || (int)cp.PointNumber != 506) continue;
        double e=cp.Easting, n=cp.Northing;
        double q = 83 + 36/60.0 + 43/3600.0;
        double az = 180.0 - q;                 // S..E quadrant
        double azr = az*Math.PI/180.0, dist=75.23;
        double ex=e+dist*Math.Sin(azr), ny=n+dist*Math.Cos(azr);
        Log($"PT 506: E={e:0.000} N={n:0.000} desc='{cp.RawDescription}'");
        Log($"ENDPOINT S83°36'43\"E 75.23': E={ex:0.000} N={ny:0.000}");
        found=true; break;
    }
    if(!found) Log("PT 506 NOT FOUND");
    tr.Commit();
}

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260619 - 3625 Stonewall Tell Rd, Atlanta, GA 30349, USA\260619 - 3625 Stonewall Tell Rd.dwg
Message
Executed C3D-RD506 (0 entities touched).
Entities
Duration
326 ms
Civil 3D
25.0.0.0

Log

PT 506: E=2166529.849 N=1330757.405 desc='IPF 1 IN CTP'
ENDPOINT S83°36'43"E 75.23': E=2166604.612 N=1330749.034

Notes

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

No notes yet.