C3D-TBDATE · Set title block DATE for 260619 running
Sets DATE to 07/22/26, the earliest field-photo date on the SurveyDisco record (no explicit survey-date field exists).
C# payload
// Set the title block DATE for job 260619 from the field-photo date (07/22/26 - earliest of the
// six site photos on the SurveyDisco record). The record has no explicit survey-date field.
// Reads back and verifies. Host owns Tx; host regens after commit.
const string BLK = "SS_BLOCK_22X17", LAYOUT = "22X17 C";
const string WANT = "DATE: 07/22/26";
var layDict = (DBDictionary)Tx.GetObject(Db.LayoutDictionaryId, OpenMode.ForRead);
var layout = (Layout)Tx.GetObject(layDict.GetAt(LAYOUT), OpenMode.ForRead);
var ps = (BlockTableRecord)Tx.GetObject(layout.BlockTableRecordId, OpenMode.ForRead);
foreach (ObjectId id in ps)
{
var b0 = Tx.GetObject(id, OpenMode.ForRead) as BlockReference;
if (b0 == null) continue;
var d0 = (BlockTableRecord)Tx.GetObject(b0.BlockTableRecord, OpenMode.ForRead);
if (d0.Name != BLK) continue;
foreach (ObjectId aid in b0.AttributeCollection)
{
var ar = Tx.GetObject(aid, OpenMode.ForRead) as AttributeReference;
if (ar == null || ar.Tag != "DATE") continue;
string old = ar.TextString;
if (old == WANT) { Log($"DATE already '{WANT}'."); return; }
var w = (AttributeReference)Tx.GetObject(aid, OpenMode.ForWrite);
w.TextString = WANT;
string now = ((AttributeReference)Tx.GetObject(aid, OpenMode.ForRead)).TextString;
Log($"DATE: '{old}' -> '{now}'{(now == WANT ? " (verified)" : " (MISMATCH)")}");
return;
}
}
Log("No DATE attribute found.");
Result
Log
DATE: 'DATE: 10/16/25' -> 'DATE: 07/22/26' (verified)
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.