← Inbox

C3D-0069 · READ-ONLY: where are V-NODE-WATR and V-NODE-TEXT used [VNODE-CHECK] done

My filter scan counted only layout block table records, so entities inside block definitions or layers driven by point/label styles were invisible. Checks every block table record for both layers and reports layout vs block-definition usage plus layer state. No changes.

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

C# payload

// READ-ONLY. User says V-NODE-WATR and V-NODE-TEXT are used; my scan counted 0 for both.
// My scan only counted entities in LAYOUT block table records (btr.IsLayout). Anything living
// inside a BLOCK DEFINITION, or referenced as a CogoPoint's marker/label layer, was invisible
// to it. Check every one of those places. Nothing is modified.
var lt = (LayerTable)Tx.GetObject(Db.LayerTableId, OpenMode.ForRead);
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
string[] TARGETS = new string[] { "V-NODE-WATR", "V-NODE-TEXT" };

foreach (string t in TARGETS) {
    Log("");
    Log("=== " + t + " ===");
    if (!lt.Has(t)) { Log("  layer does not exist"); continue; }
    var l = (LayerTableRecord)Tx.GetObject(lt[t], OpenMode.ForRead);
    Log("  off=" + l.IsOff + " frozen=" + l.IsFrozen + " locked=" + l.IsLocked + " plottable=" + l.IsPlottable);

    // 1) direct entities, EVERY btr - layouts AND block definitions
    int inLayout = 0, inBlockDef = 0;
    var where = new Dictionary<string,int>();
    foreach (ObjectId btrId in bt) {
        var btr = (BlockTableRecord)Tx.GetObject(btrId, OpenMode.ForRead);
        foreach (ObjectId id in btr) {
            Autodesk.AutoCAD.DatabaseServices.DBObject o;
            try { o = Tx.GetObject(id, OpenMode.ForRead); } catch { continue; }
            var ent = o as Autodesk.AutoCAD.DatabaseServices.Entity;
            if (ent == null) continue;
            string lay; try { lay = ent.Layer; } catch { continue; }
            if (lay != t) continue;
            if (btr.IsLayout) inLayout++; else inBlockDef++;
            string k = (btr.IsLayout ? "LAYOUT " : "BLOCKDEF ") + btr.Name + " / " + o.GetType().Name;
            if (!where.ContainsKey(k)) where[k] = 0;
            where[k]++;
        }
    }
    Log("  direct entities: layouts=" + inLayout + "  block definitions=" + inBlockDef);
    foreach (var kv in where) Log("     " + kv.Key + " x" + kv.Value);
}

// 2) CogoPoints can drive marker/label layers through their STYLE, which no entity scan sees.
Log("");
Log("=== point styles / label styles referencing these layers ===");
var civil = CivilApplication.ActiveDocument;
try {
    foreach (ObjectId sid in civil.Styles.PointStyles) {
        var ps = Tx.GetObject(sid, OpenMode.ForRead);
        var nm = ((SymbolTableRecord)ps).Name;
        Log("  point style: " + nm);
    }
} catch (System.Exception ex) { Log("  point styles: " + ex.Message); }

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-0069 (0 entities touched).
Entities
Duration
774 ms
Civil 3D
25.0.0.0

Log


=== V-NODE-WATR ===
  off=False frozen=False locked=False plottable=True
  direct entities: layouts=0  block definitions=3
     BLOCKDEF A$C3840e5d8 / BlockReference x2
     BLOCKDEF A$C0e029bf8 / Line x1

=== V-NODE-TEXT ===
  off=False frozen=False locked=False plottable=True
  direct entities: layouts=0  block definitions=0

=== point styles / label styles referencing these layers ===
  point styles: Unable to cast object of type 'Autodesk.Civil.DatabaseServices.Styles.PointStyle' to type 'Autodesk.AutoCAD.DatabaseServices.SymbolTableRecord'.

Notes

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

No notes yet.