← Inbox

C3D-BLKLIST · List block definitions done

Read-only: user-named block definitions in the drawing sorted by handle, to find a newly added 22x17 title block.

Script file
C3D-BLKLIST.cs
Target
active document · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// READ-ONLY: list user-named block definitions in THIS drawing (skip anonymous *U/*D/*X/A$C
// and layout records), newest handles last, to spot a newly created 22x17 title block.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var rows = new List<(long h, string name, int n, int refs)>();
foreach (ObjectId id in bt)
{
    var btr = (BlockTableRecord)Tx.GetObject(id, OpenMode.ForRead);
    if (btr.IsLayout) continue;
    var nm = btr.Name;
    if (nm.StartsWith("*") || nm.StartsWith("A$C") || nm.StartsWith("_")) continue;
    int n = 0; foreach (ObjectId x in btr) n++;
    int refs = btr.GetBlockReferenceIds(true, true).Count;
    rows.Add((System.Convert.ToInt64(btr.Handle.ToString(), 16), nm, n, refs));
}
rows.Sort((a,b) => a.h.CompareTo(b.h));
Log($"{rows.Count} user block definitions (oldest handle first):");
foreach (var r in rows) Log($"  h={r.h:X}  {r.name}   entities={r.n} refs={r.refs}");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\SS_BLOCK_22X17_R2.dwg
Message
Executed C3D-BLKLIST (0 entities touched).
Entities
Duration
493 ms
Civil 3D
25.0.0.0

Log

83 user block definitions (oldest handle first):
  h=DE4  AeccTickLine   entities=1 refs=0
  h=DEF  AeccTickCircle   entities=1 refs=0
  h=13FD  AeccTickTriangle   entities=2 refs=0
  h=15F8  AeccArrow   entities=1 refs=0
  h=174D  Shrub 2   entities=1 refs=0
  h=1751  Well   entities=3 refs=0
  h=1757  Gas Valve   entities=5 refs=0
  h=175F  Drainage MH   entities=2 refs=2
  h=177E  Proposed Hyd   entities=11 refs=0
  h=178C  Single Pole Sign   entities=2 refs=0
  h=1791  Water Shutoff   entities=4 refs=0
  h=17AA  Drill Hole   entities=3 refs=0
  h=17B0  STA   entities=2 refs=2
  h=17B5  Station Mark   entities=4 refs=0
  h=17BC  Sewer Manhole   entities=2 refs=0
  h=17C1  Benchmark   entities=5 refs=0
  h=17C9  Existing Hyd   entities=10 refs=2
  h=17D6  Water Valve   entities=5 refs=2
  h=17DE  Tree 6   entities=144 refs=0
  h=1871  Catch Basin   entities=4 refs=2
  h=1878  Iron Pin   entities=2 refs=0
  h=187D  Guy Pole   entities=5 refs=0
  h=1885  Test Pit   entities=4 refs=0
  h=188C  bound   entities=5 refs=0
  h=1894  Utility Pole   entities=5 refs=0
  h=20B7  Marker Pnt   entities=3 refs=0
  h=2770  AeccSectionMark   entities=2 refs=0
  h=2775  AeccSectionPntr   entities=1 refs=0
  h=2C07  Storm Manhole   entities=2 refs=0
  h=2D63  Flared End Section - Plan   entities=5 refs=0
  h=2D6B  Flared End Section - Profile   entities=4 refs=0
  h=3511  SuperLeftUpEmpty   entities=1 refs=0
  h=3515  SuperLeftDownEmpty   entities=1 refs=0
  h=3519  SuperRightDownEmpty   entities=1 refs=0
  h=351D  SuperRightUpEmpty   entities=1 refs=0
  h=35C0  HighPoint   entities=3 refs=0
  h=35CA  LowPoint   entities=3 refs=0
  h=3731  FullSuperLeftDownEmpty   entities=1 refs=0
  h=3735  FullSuperLeftUpEmpty   entities=1 refs=0
  h=3739  FullSuperRightUpEmpty   entities=1 refs=0
  h=373D  FullSuperRightDownEmpty   entities=1 refs=0
  h=3951  AeccArwClosedFilled   entities=1 refs=0
  h=4735  Tree-Deciduous   entities=3 refs=0
  h=473B  Hydrant-Elevation   entities=21 refs=0
  h=4755  Tree-Evergreen   entities=5 refs=0
  h=60EB  HBCMW   entities=0 refs=0
  h=60F1  HBPCW   entities=0 refs=0
  h=7F70  PRESSUREPARTERRORBLOCK   entities=5 refs=0
  h=7F7E  4b489b62-e834-4762-a085-7954ec19726a   entities=1 refs=0
  h=7F84  4b489b62-e834-4762-a085-7954ec19726a_3   entities=1 refs=0
  h=7F8A  e2d441ea-1ff1-48e7-ba14-35cae9d44af1   entities=1 refs=0
  h=7F90  e2d441ea-1ff1-48e7-ba14-35cae9d44af1_3   entities=1 refs=0
  h=10CC7  145624724635_Symbols CAD Block_Wheel chair symbol   entities=2 refs=0
  h=10F97  CLOSEOUT   entities=2 refs=0
  h=1242C  ARROW   entities=2 refs=0
  h=12432  CG-T30   entities=334 refs=2
  h=12583  EX-TREE2   entities=3 refs=0
  h=1258A  EX-TREE3   entities=1 refs=0
  h=1258F  EX-TREE4   entities=2 refs=0
  h=12596  EX-TREE5   entities=24 refs=0
  h=125B2  EX-TREE6   entities=49 refs=0
  h=125E7  EX-TREE8   entities=68 refs=0
  h=1263A  BOULDER   entities=14 refs=0
  h=1264D  EX-TREE1   entities=3 refs=0
  h=1859E  SP0   entities=2 refs=0
  h=185A3  SP4   entities=80 refs=0
  h=185F6  SP5   entities=2093 refs=0
  h=18E26  SP6   entities=12 refs=0
  h=18E35  SP7   entities=12 refs=0
  h=18E44  SP8   entities=12 refs=0
  h=18E53  SP9   entities=12 refs=0
  h=18E62  SP10   entities=12 refs=0
  h=18E71  SP11   entities=12 refs=0
  h=18E80  SP12   entities=12 refs=0
  h=18E8F  SP13   entities=12 refs=0
  h=18E9E  SP14   entities=12 refs=0
  h=1D012  3136   entities=40 refs=0
  h=1F6BB  SS_BLOCK_11X17   entities=44 refs=3
  h=1FDA3  SS_LEGEND   entities=20 refs=2
  h=1FE18  11x17 COVER SHEET SS   entities=163 refs=0
  h=1FEE5  SS_BLOCK_11X17 (1)   entities=106 refs=0
  h=1FF68  SS_BLOCK_11X17 (2)   entities=106 refs=0
  h=20019  SS_BLOCK_11X17 (3)   entities=106 refs=0

Notes

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

No notes yet.