← Inbox

C3D-CONTRACTVER · Verify CONTRACT.dwg coord tie + parcels (read-only) done

Check for any real coordinate tie/georeference and re-list parcels

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

C# payload

// Read-only side db on CONTRACT.dwg: does it carry anything that PROVES the geometry is on real
// state plane (a monument N/E tie, a stated coordinate, a geo-reference), and re-list the parcels.
string path = @"C:\Users\sanja\OneDrive\_SurveyDisco\_DRAFTS\CONTRACT.dwg";
if (!System.IO.File.Exists(path)) { Log("not found"); return; }
using (var sdb = new Database(false, true)) {
    sdb.ReadDwgFile(path, System.IO.FileShare.Read, true, null);
    Log($"file coord-system label: (reading)");
    using (var t = sdb.TransactionManager.StartTransaction()) {
        var bt = (BlockTable)t.GetObject(sdb.BlockTableId, OpenMode.ForRead);

        // any explicit N=/E= coordinate tie, monument, benchmark, control note?
        var rxNE = new System.Text.RegularExpressions.Regex(@"[NE]\s*[:=]\s*\d{5,}");
        int tie = 0;
        foreach (ObjectId btrId in bt) {
            var btr = (BlockTableRecord)t.GetObject(btrId, OpenMode.ForRead);
            string where = btr.Name;
            if (btr.IsLayout) { var lay = (Layout)t.GetObject(btr.LayoutId, OpenMode.ForRead); where = "L:" + lay.LayoutName; }
            foreach (ObjectId id in btr) {
                var o = t.GetObject(id, OpenMode.ForRead);
                string s = null;
                if (o is MText mt) s = (mt.Contents ?? "").Replace("\\P"," / ");
                else if (o is DBText tx) s = tx.TextString ?? "";
                else continue;
                var clean = System.Text.RegularExpressions.Regex.Replace(s, @"\\[A-Za-z][^;\\]*;|[{}]", "");
                var u = clean.ToUpperInvariant();
                if (rxNE.IsMatch(clean) || u.Contains("MONUMENT") || u.Contains("BENCHMARK") ||
                    u.Contains("CONTROL POINT") || u.Contains("N.A.D") || u.Contains("NAD 83") ||
                    u.Contains("NAD83") || u.Contains("STATE PLANE") || u.Contains("GEORGIA WEST") ||
                    u.Contains("GA WEST") || u.Contains("BASIS OF BEARING") || u.Contains("GPS")) {
                    if (!(u.Contains("INV")||u.Contains("TOP=")||u.Contains("IE"))) { Log($"  [TIE][{where}] \"{clean.Trim()}\""); tie++; }
                }
            }
        }
        Log($"coordinate-tie candidates: {tie}");

        // does the drawing have a geo-reference (real georeferencing, not just a code)?
        try {
            var geo = t.GetObject(sdb.NamedObjectsDictionaryId, OpenMode.ForRead) as DBDictionary;
            Log($"has ACAD_GEOGRAPHICDATA: {(geo != null && geo.Contains("ACAD_GEOGRAPHICDATA"))}");
        } catch (System.Exception ex) { Log("geo check: " + ex.Message); }

        // parcels / adjoiners again
        Log("=== parcels / adjoiners ===");
        foreach (ObjectId btrId in bt) {
            var btr = (BlockTableRecord)t.GetObject(btrId, OpenMode.ForRead);
            foreach (ObjectId id in btr) {
                var o = t.GetObject(id, OpenMode.ForRead);
                string s = null;
                if (o is MText mt) s = (mt.Contents ?? "").Replace("\\P"," / ");
                else if (o is DBText tx) s = tx.TextString ?? "";
                else continue;
                var u = (s ?? "").ToUpperInvariant();
                if (u.Contains("PARCEL") || u.Contains("N/F") || u.Contains("LAUREL") || u.Contains("LOT-") || u.Contains("LOT ")) {
                    var clean = System.Text.RegularExpressions.Regex.Replace(s, @"\\[A-Za-z][^;\\]*;|[{}]", "");
                    Log($"  \"{clean.Trim()}\"");
                }
            }
        }
        t.Commit();
    }
}

Result

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

Log

file coord-system label: (reading)
  [TIE][L:Model] "ENTRANCE MONUMENT"
coordinate-tie candidates: 1
has ACAD_GEOGRAPHICDATA: False
=== parcels / adjoiners ===
  "LOT-1"
  "LOT-2"
  "LOT-3"
  "LAKE LAUREL DRIVE"
  "TAX PARCEL 137 483"
  "N/F / CHEEK GREGORY DEXTER SR & / CHEEK MARILYN DIANE / ZONED A1 / TAX PAR. 137 013"
  "N/F / MATHIS LORENE W / ZONED A1 / TAX PAR. 137 012"
  "N/F / ROBINSON DARREN & / ROBINSON SYLIAN / ZONED RES2 / TAX PAR. 137 526"
  "N/F / DAKA SIREESHA & / DAKA VENKATA PHANI / ZONED RES2 / TAX PAR. 137 527"
  "\LPROP. LOT 3 BASIN / A=0.46 AC. / CN=71 / Tc=6 MIN."
  "\LPROP. LOT 2 BASIN / A=0.27 AC. / CN=79 / Tc=6 MIN."
  "\LPROP. LOT 1 BASIN / A=0.28 AC. / CN=78 / Tc=6 MIN."
  "CONCEPTUAL LOCATION INDIVIDUAL / LOT INFILTRATION SYSTEM (TYP.)"

Notes

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

No notes yet.