← Inbox

C3D-FLOWCHECK · Search drawing text for flow direction notes (read-only) done

Search all text/mtext for FLOW/DIRECTIONALITY/ARROW mentions.

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

C# payload

// READ-ONLY: search all text/mtext in the drawing for anything about flow direction / arrows / FL.
using System;
using Autodesk.AutoCAD.DatabaseServices;

var db = Db;
using (var tr = db.TransactionManager.StartTransaction())
{
    var ms = (BlockTableRecord)tr.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForRead);
    int n = 0;
    foreach (ObjectId id in ms)
    {
        var e = tr.GetObject(id, OpenMode.ForRead);
        string s = null;
        if (e is DBText t) s = t.TextString;
        else if (e is MText m) s = m.Text;
        if (string.IsNullOrWhiteSpace(s)) continue;
        var u = s.ToUpperInvariant();
        if (u.Contains("FLOW") || u.Contains("DIRECTIONALITY") || u.Contains("ARROW"))
        {
            Log($"  '{s.Replace("\n"," ")}'");
            n++;
        }
    }
    Log($"matches: {n}");
    tr.Commit();
}

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\SS_Outfall_260612_SHEET.dwg
Message
Executed C3D-FLOWCHECK (0 entities touched).
Entities
Duration
403 ms
Civil 3D
25.0.0.0

Log

matches: 0

Notes

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

No notes yet.