← Inbox

C3D-ADDCPP · Add 3 CPP control points for field recovery (GUS.dwg) done

Adds CPP-coded control points at existing features to shoot in the field for the state-plane shift: CPP1 at FIP #9203 (NW), CPP2 at FIP #9208 (N), CPP3 at SSMH #9204 rim (check). Occupy each, shoot its TRUE GA-West N/E, and the drawing<->real pairs solve the translation/rotation. Additive; verifies each point.

Script file
C3D-ADDCPP.cs
Target
C:\Users\sanja\Downloads\GUS.dwg · model space
Author
claude
Approved
yes · reviewer
Timeout
60s

C# payload

// Add 3 control points (desc code CPP) at existing survey features that are good field-recovery
// targets for the state-plane shift: two found iron pins (real monuments) + one manhole rim as a
// check. Placed at the SAME drawing coords as the existing points so the user occupies a known
// feature, shoots its true GA-West N/E, and we match drawing<->real to solve the translation.
// Additive; verifies each point was created.
var cd = CivilDoc; var cps = cd.CogoPoints;

// pull the source points by number
var want = new (uint num, string label)[] {
    (9203, "CPP1 (FIP - NW)"),
    (9208, "CPP2 (FIP - N)"),
    (9204, "CPP3 (SSMH rim - CHECK)"),
};
var src = new Dictionary<uint, Point3d>();
foreach (ObjectId id in cps) {
    var cp = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForRead);
    foreach (var w in want) if (cp.PointNumber == w.num)
        src[w.num] = new Point3d(cp.Easting, cp.Northing, cp.Elevation);
}

// next free point number
uint next = 1;
foreach (ObjectId id in cps) {
    var cp = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(id, OpenMode.ForRead);
    if (cp.PointNumber >= next) next = cp.PointNumber + 1;
}

int made = 0;
foreach (var w in want) {
    if (!src.ContainsKey(w.num)) { Log($"source #{w.num} not found - skip"); continue; }
    var p = src[w.num];
    ObjectId nid = cps.Add(p, "CPP", true);   // desc code CPP
    var cp = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(nid, OpenMode.ForWrite);
    cp.PointNumber = next;
    cp.RawDescription = "CPP " + w.label;
    var chk = (Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(nid, OpenMode.ForRead);
    Log($"  CPP #{chk.PointNumber} '{chk.RawDescription}' at existing #{w.num}  E={chk.Easting:F3} N={chk.Northing:F3} Z={chk.Elevation:F3} (verified)");
    next++; made++;
}
Log($"CPP control points added: {made}");
Log("FIELD: occupy each feature, shoot its TRUE GA-West N/E, give me the pairs -> I solve the shift.");

Result

Status
success
Drawing file
C:\Users\sanja\Downloads\GUS.dwg
Message
Executed C3D-ADDCPP (0 entities touched).
Entities
Duration
350 ms
Civil 3D
25.0.0.0

Log

  CPP #10055 'CPP CPP1 (FIP - NW)' at existing #9203  E=2356009.132 N=1391584.301 Z=414.573 (verified)
  CPP #10056 'CPP CPP2 (FIP - N)' at existing #9208  E=2355987.453 N=1391577.140 Z=414.452 (verified)
  CPP #10057 'CPP CPP3 (SSMH rim - CHECK)' at existing #9204  E=2356006.852 N=1391583.312 Z=414.836 (verified)
CPP control points added: 3
FIELD: occupy each feature, shoot its TRUE GA-West N/E, give me the pairs -> I solve the shift.

Notes

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

No notes yet.