← Inbox

C3D-0376 · READ-ONLY: V-NODE + control layer - frozen state + top-level vs in-block content [C3D-VNODEDIAG] done

For every V-NODE* layer and the control-point layer, reports frozen/off state and splits its content into top-level (standalone geometry) vs in-block (symbol internals). This confirms which layers hold only block guts - safe to move off - versus anything standalone that was frozen deliberately.

Script file
C3D-0376.cs
Target
260612-Springdale Sanitary Sewer Extension As-Built 60 wPROFILE.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
120s

C# payload

// V-NODE-TEXT and "the control layer" (HORIZONTAL_AND_VERTICAL_CONTROL_POINT) blank when frozen.
// Show: which V-NODE* layers are frozen, and for each, how much of their content is TOP-LEVEL
// vs inside block definitions - so we move only block-internal geometry, not things frozen on
// purpose.
Log("drawing: " + Db.Filename);
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var lt = (LayerTable)Tx.GetObject(Db.LayerTableId, OpenMode.ForRead);

// frozen/off state of the relevant layers
Log("=== layer states ===");
foreach (ObjectId id in lt) {
    var l = (LayerTableRecord)Tx.GetObject(id, OpenMode.ForRead);
    if (l.Name.StartsWith("V-NODE", StringComparison.OrdinalIgnoreCase) ||
        l.Name.IndexOf("CONTROL", StringComparison.OrdinalIgnoreCase) >= 0)
        Log(string.Format("  {0,-40} {1}{2}", l.Name, l.IsFrozen?"FROZEN ":"thawed ", l.IsOff?"OFF":""));
}

// for each target layer, count top-level (in a layout btr) vs block-internal occurrences
var targets = new List<string>();
foreach (ObjectId id in lt) {
    var l = (LayerTableRecord)Tx.GetObject(id, OpenMode.ForRead);
    if (l.Name.StartsWith("V-NODE", StringComparison.OrdinalIgnoreCase) ||
        l.Name.IndexOf("CONTROL", StringComparison.OrdinalIgnoreCase) >= 0) targets.Add(l.Name);
}
Log("");
Log("=== content location per layer (top-level = standalone; in-block = symbol guts) ===");
foreach (var t in targets) {
    int top=0, inblk=0;
    foreach (ObjectId bid in bt) {
        var def = (BlockTableRecord)Tx.GetObject(bid, OpenMode.ForRead);
        foreach (ObjectId sid in def) {
            var e = Tx.GetObject(sid, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
            if (e == null || !e.Layer.Equals(t, StringComparison.OrdinalIgnoreCase)) continue;
            if (def.IsLayout) top++; else inblk++;
        }
    }
    if (top>0 || inblk>0)
        Log(string.Format("  {0,-40} top-level={1}  in-block={2}", t, top, inblk));
}

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\ACAD-260612-Springdale Sanitary Sewer Extension As-Built 60 wPROFILE.dwg
Message
Executed C3D-0376 (0 entities touched).
Entities
Duration
769 ms
Civil 3D
25.0.0.0

Log

drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\ACAD-260612-Springdale Sanitary Sewer Extension As-Built 60 wPROFILE.dwg
=== layer states ===
  V-NODE-TEXT                              thawed 
  V-NODE-TREE                              thawed 
  V-NODE-WATR                              thawed 
  V-NODE-STRM                              thawed 
  V-NODE-BNDY                              thawed 
  V-NODE-POLE                              thawed 
  V-NODE-BORE                              thawed 
  HORIZONTAL_AND_VERTICAL_CONTROL_POINT    thawed 

=== content location per layer (top-level = standalone; in-block = symbol guts) ===
  V-NODE-TEXT                              top-level=0  in-block=106
  V-NODE-TREE                              top-level=0  in-block=2
  V-NODE-WATR                              top-level=0  in-block=37
  V-NODE-STRM                              top-level=0  in-block=14
  V-NODE-BNDY                              top-level=0  in-block=8
  V-NODE-POLE                              top-level=0  in-block=2
  V-NODE-BORE                              top-level=0  in-block=1
  HORIZONTAL_AND_VERTICAL_CONTROL_POINT    top-level=1  in-block=0

Notes

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

No notes yet.