C3D-TBREAD · Read title block attributes (read-only) done
Enumerate attributed blocks across layouts to see the title block tags before filling
C# payload
// Read-only: enumerate block references with attributes across ALL layouts + model, so we can see
// the title block's attribute TAGS and current values before writing anything.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
int nb = 0;
foreach (ObjectId btrId in bt) {
var btr = (BlockTableRecord)Tx.GetObject(btrId, OpenMode.ForRead);
if (btr.IsLayout) {
var lay = (Layout)Tx.GetObject(btr.LayoutId, OpenMode.ForRead);
foreach (ObjectId id in btr) {
var o = Tx.GetObject(id, OpenMode.ForRead);
if (o is BlockReference br) {
var def = (BlockTableRecord)Tx.GetObject(br.DynamicBlockTableRecord, OpenMode.ForRead);
if (br.AttributeCollection == null || br.AttributeCollection.Count == 0) continue;
Log($"--- LAYOUT '{lay.LayoutName}' BLOCK '{def.Name}' handle={br.Handle} attrs={br.AttributeCollection.Count}");
foreach (ObjectId aid in br.AttributeCollection) {
var ar = (AttributeReference)Tx.GetObject(aid, OpenMode.ForRead);
Log($" TAG '{ar.Tag}' = \"{ar.TextString}\"");
}
nb++;
}
}
}
}
Log($"BLOCKS WITH ATTRIBUTES: {nb}");
Result
Log
--- LAYOUT '11X17' BLOCK 'SS_BLOCK_11X17' handle=20355 attrs=10
TAG 'JOB_NO' = "JOB NO.: 251103"
TAG 'SITE_ADDRESS' = "2850 Riderwood Dr, Decatur, GA 30033, USA"
TAG 'REF_DB_PG' = "REF DB Page "
TAG 'LAND_LOT' = "LAND LOT: 147"
TAG 'DISTRICT' = "DISTRICT: 18th"
TAG 'COUNTY' = "COUNTY: Dekalb"
TAG 'DATE' = "DATE: 11/11/25"
TAG 'SUBDIVISION_NAME_LOT' = ""
TAG 'PREP_FOR' = "ANGELA & LLOYD BARNETT"
TAG 'SURVEY_TYPE' = "Survey"
BLOCKS WITH ATTRIBUTES: 1Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.