C3D-FLOODFIX2 · Correct FIRM panel on flood note done
Replaces panel 13135C0016G / February 4, 2013 with 13121C0338F / September 18, 2013 from the SurveyDisco record for job 260619 (Fulton County). Zone X unchanged. Reads back and verifies.
C# payload
// Correct the flood note on 22X17 C: the FIRM panel/date were from another county.
// SurveyDisco record for job 260619 (Fulton County): firmPanel 13121C0338F,
// firmPanelDate 09/18/2013, floodZone X. Sheet had 13135C0016G / February 4, 2013 (Gwinnett).
// Reads back and verifies. Host owns Tx; host regens after commit.
const string LAYOUT = "22X17 C";
const string OLD_PANEL = "13135C0016G", NEW_PANEL = "13121C0338F";
const string OLD_DATE = "FEBRUARY 4, 2013", NEW_DATE = "SEPTEMBER 18, 2013";
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);
int fixedN = 0;
foreach (ObjectId id in ps)
{
var mt = Tx.GetObject(id, OpenMode.ForRead) as MText;
if (mt == null) continue;
var c = mt.Contents;
if (c == null || (!c.Contains(OLD_PANEL) && !c.ToUpper().Contains(OLD_DATE))) continue;
string updated = c.Replace(OLD_PANEL, NEW_PANEL);
int i = updated.ToUpper().IndexOf(OLD_DATE);
if (i >= 0) updated = updated.Substring(0, i) + NEW_DATE + updated.Substring(i + OLD_DATE.Length);
if (updated == c) { Log(" no change needed"); continue; }
var w = (MText)Tx.GetObject(id, OpenMode.ForWrite);
w.Contents = updated;
string now = ((MText)Tx.GetObject(id, OpenMode.ForRead)).Contents;
bool ok = now.Contains(NEW_PANEL) && now.Contains(NEW_DATE) && !now.Contains(OLD_PANEL);
Log("MText " + mt.Handle + " on '" + mt.Layer + "':");
Log(" OLD: " + c);
Log(" NEW: " + now);
Log(ok ? " (verified)" : " (MISMATCH)");
fixedN++;
}
Log("Corrected " + fixedN + " flood note(s) to panel " + NEW_PANEL + ", " + NEW_DATE + ", Zone X (Fulton County).");
Result
Log
MText 214F2 on 'BLOCK_NOTES_FLOOD': OLD: FLOOD NOTE:\PTHIS PROPERTY IS NOT LOCATED WITHIN A SPECIAL FLOOD HAZARD AREA (SFHA) AS SHOWN ON F.I.R.M. COMMUNITY PANEL NO. 13135C0016G, EFFECTIVE FEBRUARY 4, 2013, AND LIES IN ZONE X. NEW: FLOOD NOTE:\PTHIS PROPERTY IS NOT LOCATED WITHIN A SPECIAL FLOOD HAZARD AREA (SFHA) AS SHOWN ON F.I.R.M. COMMUNITY PANEL NO. 13121C0338F, EFFECTIVE SEPTEMBER 18, 2013, AND LIES IN ZONE X. (verified) Corrected 1 flood note(s) to panel 13121C0338F, SEPTEMBER 18, 2013, Zone X (Fulton County).
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.