← Inbox

C3D-0028 · Read parcels and segment labels [PARCEL-CHK] done

Read-only: all sites and parcels with areas, every ParcelSegmentLabel with its layer/style/flip/parent and whether its layer is off or frozen, plus what is on SEWER_EASEMENT.

Script file
C3D-0028.cs
Target
260612 · model space
Author
claude
Approved
yes · reviewer
Timeout
180s

C# payload

// READ-ONLY: every site, its parcels, and every parcel-segment label with its tag/style/flip,
// so the easement parcel's labels can be seen as they actually are.
var cd = CivilDoc;
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);

Log("=== sites / parcels ===");
foreach (ObjectId sid in cd.GetSiteIds())
{
    var site = Tx.GetObject(sid, OpenMode.ForRead) as Site;
    if (site == null) continue;
    var pids = site.GetParcelIds();
    if (pids.Count == 0 && site.Name.StartsWith("{")) continue;
    Log("  Site '" + site.Name + "'  parcels=" + pids.Count);
    foreach (ObjectId pid in pids)
    {
        var p = Tx.GetObject(pid, OpenMode.ForRead) as Parcel;
        if (p == null) continue;
        Log("      '" + p.Name + "' layer='" + p.Layer + "' area=" + p.Area.ToString("N0") +
            " sf = " + (p.Area/43560.0).ToString("F3") + " ac  h=" + p.Handle);
    }
}

Log("=== ParcelSegmentLabels ===");
int n = 0;
foreach (ObjectId id in ms)
{
    var lbl = Tx.GetObject(id, OpenMode.ForRead) as ParcelSegmentLabel;
    if (lbl == null) continue;
    n++;
    string sty = "", par = "?";
    try { sty = lbl.StyleName ?? ""; } catch {}
    try {
        var pid = lbl.FeatureId;
        if (!pid.IsNull) {
            var pe = Tx.GetObject(pid, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
            par = pe == null ? "?" : pe.GetType().Name + " on '" + pe.Layer + "'";
        }
    } catch {}
    bool fl = false; try { fl = lbl.Flipped; } catch {}
    var lay = (LayerTableRecord)Tx.GetObject(
        ((LayerTable)Tx.GetObject(Db.LayerTableId, OpenMode.ForRead))[lbl.Layer], OpenMode.ForRead);
    Log("  h=" + lbl.Handle + " layer='" + lbl.Layer + "'" + (lay.IsOff ? " [LAYER OFF]" : "") +
        (lay.IsFrozen ? " [FROZEN]" : "") + " style='" + sty + "' flipped=" + fl + "  parent=" + par);
}
Log("  total " + n + " parcel segment label(s)");

Log("=== SEWER_EASEMENT contents ===");
foreach (ObjectId id in ms)
{
    var e = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (e == null || e.Layer != "SEWER_EASEMENT") continue;
    var pl = e as Polyline;
    Log("  " + e.GetType().Name + " h=" + e.Handle +
        (pl != null ? "  verts=" + pl.NumberOfVertices + " closed=" + pl.Closed +
                      " area=" + pl.Area.ToString("N0") : ""));
}

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\260612 - CSTORE WATER ABS 30.dwg
Message
Executed C3D-0028 (0 entities touched).
Entities
Duration
417 ms
Civil 3D
25.0.0.0

Log

=== sites / parcels ===
  Site 'PROPERTY LINE'  parcels=1
      'Property : 1' layer='C-PROP' area=178,277 sf = 4.093 ac  h=2E1EC
  Site 'SEWER EASEMENT'  parcels=3
      'Basic : 4' layer='C-PROP' area=4 sf = 0.000 ac  h=2EE58
      'SEWER EASEMENT' layer='SEWER_EASEMENT_20' area=11,553 sf = 0.265 ac  h=2393A
      'Basic : 3' layer='C-PROP' area=12,611 sf = 0.289 ac  h=2EE57
=== ParcelSegmentLabels ===
  h=23925 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=23926 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=23927 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=23928 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=23929 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2392A layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2392B layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2392C layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2392D layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2392E layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2392F layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=23930 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=23931 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=23932 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=23933 layer='0' style='Standard.Tag.1' flipped=True  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2E1ED layer='C-PROP-LINE-TEXT' style='Bearing over Distance' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2E1EE layer='C-PROP-LINE-TEXT' style='Bearing over Distance' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2E1EF layer='C-PROP-LINE-TEXT' style='Delta over Length and Radius' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2E1F0 layer='C-PROP-LINE-TEXT' style='Delta over Length and Radius' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2E1F1 layer='C-PROP-LINE-TEXT' style='Delta over Length and Radius' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2E1F2 layer='C-PROP-LINE-TEXT' style='Delta over Length and Radius' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2E1F3 layer='C-PROP-LINE-TEXT' style='Bearing over Distance' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2E1F4 layer='C-PROP-LINE-TEXT' style='Bearing over Distance' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE59 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE5A layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE5B layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE5C layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE5D layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE5E layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE5F layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE60 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE61 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE62 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE63 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE64 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE65 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE66 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE67 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE68 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE69 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE6A layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE6B layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE6C layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE6D layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'C-PROP-LINE'
  h=2EE6E layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2EE6F layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  h=2EE70 layer='C-PROP-LINE-TEXT' style='Standard' flipped=False  parent=ParcelSegment on 'SEWER_EASEMENT_20'
  total 47 parcel segment label(s)
=== SEWER_EASEMENT contents ===
  Site h=23922
  Polyline h=2EE30  verts=19 closed=True area=24,163

Notes

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

No notes yet.