← Inbox

C3D-PDFLAYERS2 · Full PDF block layer inventory (read-only) done

READ-ONLY. Lists all 72 layers inside the imported PDF block with entity counts, so the keep/drop split can be reviewed BEFORE anything is erased.

Script file
C3D-PDFLAYERS2.cs
Target
active document · model space
Author
claude
Approved
yes · reviewer
Timeout
60s

C# payload

// Read-only: full layer inventory INSIDE the PDF block definition, so we can decide what to
// strip (contours/grading/title block) vs keep (sewer/water/RW/boundary).
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
BlockTableRecord def = null;
foreach (ObjectId id in bt) {
    var b = (BlockTableRecord)Tx.GetObject(id, OpenMode.ForRead);
    if (b.Name.Contains("As Built") || b.Name.Contains("DEV3896")) { def = b; break; }
}
if (def == null) { Log("block def not found"); return; }
var tally = new Dictionary<string,int>();
int total = 0;
foreach (ObjectId id in def) {
    var e = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (e == null) continue;
    total++;
    tally[e.Layer] = tally.TryGetValue(e.Layer, out var n) ? n+1 : 1;
}
Log($"TOTAL entities in block: {total}, layers: {tally.Count}");
foreach (var kv in tally.OrderByDescending(x => x.Value)) Log($"  {kv.Value,6}  {kv.Key}");

Result

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

Log

TOTAL entities in block: 10996, layers: 72
    5365  PDF_INTER_CONTOURS
    1152  PDF_INDEX_CONTOURS
     477  PDF_C-SIDEWLK-HTC
     427  PDF_E GRAVEL
     408  PDF_PGRADE
     324  PDF_V-BNDY-ANNO
     280  PDF_V-POWR-OVHD
     246  PDF_C-CURB-FACE
     238  PDF_V-ROAD-CURB
     228  PDF_ae_title-36x24$TBORDER
     200  PDF_Text
     137  PDF_V-WATR
     126  PDF_C-STRIPES
     120  PDF_C-BLDG-COLS
     100  PDF_C-SSWR-PIPE
      93  PDF_ae_title-36x24$T-BD-COPY
      73  PDF_0-PIPE-SS-A-T
      69  PDF_GRAPHIC_SCALE
      61  PDF_C-SSWR-PIPE-PATT
      61  PDF_V-ROAD-MRKG
      59  PDF_ae_title-36x24$SEAL2
      45  PDF_C-WATR-CNTR
      42  PDF_0-PIPE-STM C
      41  PDF_V-RIVR-EDGE
      33  PDF_C-SSWR-LATS
      32  PDF_0-PIPE-STM B
      32  PDF_0-PIPE-STM A
      31  PDF_0-ALIGN-SDL2-T
      30  PDF_E IPF-SET
      30  PDF_0-PIPE-SS-A
      30  PDF_ae_title-36x24$TITLE
      29  PDF_C-WATR-ANNO
      27  PDF_ae_title-36x24$T-BD-INFO2
      25  PDF_C-STRM-CNTR
      24  PDF_C-SSWR-STRC-PATT
      23  PDF_E POWER
      21  PDF_ae_title-36x24$SEAL
      19  PDF_ae_title-36x24$T-BD-PROJ2
      18  PDF_V-STRM-GRAT
      17  PDF_E STORM TEXT
      16  PDF_C-WATR-STRC
      16  PDF_V-SSWR
      15  PDF_C-CONC
      14  PDF_SWM
      13  PDF_V-STRM-STRC-TEXT
      13  PDF_C-ANNO
      12  PDF_ae_title-36x24$T-BD-PROJ
      12  PDF_ae_title-36x24$T-BD-LOGO
      10  PDF_C-ESMT-BLDG-SBAK
       8  PDF_ESMT v2
       8  PDF_V-SSWR-ANNO
       7  PDF_V-BNDY
       7  PDF_E STORM
       7  PDF_C-WATR-TEXT
       6  PDF_C-SIDEWALKS
       5  PDF_E FENCE
       4  PDF_C-SIGNS
       3  PDF_2015_Flood_Map_DFIRM
       3  PDF_V-ESMT
       3  PDF_ae_title-36x24$T-BD-LINE
       3  PDF_ae_title-36x24$T-BD-INFO1
       3  PDF_REVISIONS
       2  PDF_E CONCRETE
       2  PDF_E WALL
       2  PDF_E EDGE PVMT
       2  PDF_GENERAL-TEXT
       2  PDF_Level 3
       1  PDF_P-RW
       1  PDF_P-Setbacks
       1  PDF_P-ESMT
       1  PDF_NOTES
       1  PDF_0-PIPE-EX SS

Notes

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

No notes yet.