← Inbox

C3D-0023 · Flip parcel segment tag labels [FLIP-TAGS] done

Sets Flipped = true on every ParcelSegmentLabel using a Tag style (the L1-L15 tags). Bearing/distance labels are left alone. Reads each back to verify.

Script file
C3D-0023.cs
Target
260612 · model space
Author
claude
Approved
yes · reviewer
Timeout
180s

C# payload

// Set Flipped = true on every ParcelSegmentLabel using a Tag style (the L1..L15 tags).
// Label.Flipped is a settable bool on Autodesk.Civil.DatabaseServices.Label (verified by
// reflecting AeccDbMgd: Flipped SET, alongside Reversed, Dragged, Pinned).
// Targets tag-style labels only so bearing/distance labels are not disturbed.
// Reads each one back. Host owns Tx; host regens after commit.
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);

int found = 0, flipped = 0, already = 0;
foreach (ObjectId id in ms)
{
    var lbl = Tx.GetObject(id, OpenMode.ForRead) as ParcelSegmentLabel;
    if (lbl == null) continue;
    string sty = "";
    try { sty = lbl.StyleName ?? ""; } catch {}
    if (sty.ToUpper().IndexOf("TAG") < 0) continue;   // tag styles only
    found++;
    bool was;
    try { was = lbl.Flipped; } catch (System.Exception ex) { Log("  h=" + lbl.Handle + " read err: " + ex.Message); continue; }
    if (was) { already++; Log("  h=" + lbl.Handle + " style='" + sty + "' already flipped"); continue; }
    var w = (ParcelSegmentLabel)Tx.GetObject(id, OpenMode.ForWrite);
    w.Flipped = true;
    bool now = ((ParcelSegmentLabel)Tx.GetObject(id, OpenMode.ForRead)).Flipped;
    Log("  h=" + lbl.Handle + " style='" + sty + "'  flipped " + was + " -> " + now + (now ? "  (verified)" : "  (MISMATCH)"));
    if (now) flipped++;
}
Log("tag labels found " + found + "; flipped " + flipped + ", already true " + already);

Result

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

Log

  h=23925 style='Standard.Tag.1'  flipped False -> True  (verified)
  h=23926 style='Standard.Tag.1'  flipped False -> True  (verified)
  h=23927 style='Standard.Tag.1'  flipped False -> True  (verified)
  h=23928 style='Standard.Tag.1'  flipped False -> True  (verified)
  h=23929 style='Standard.Tag.1'  flipped False -> True  (verified)
  h=2392A style='Standard.Tag.1'  flipped False -> True  (verified)
  h=2392B style='Standard.Tag.1'  flipped False -> True  (verified)
  h=2392C style='Standard.Tag.1'  flipped False -> True  (verified)
  h=2392D style='Standard.Tag.1'  flipped False -> True  (verified)
  h=2392E style='Standard.Tag.1'  flipped False -> True  (verified)
  h=2392F style='Standard.Tag.1'  flipped False -> True  (verified)
  h=23930 style='Standard.Tag.1'  flipped False -> True  (verified)
  h=23931 style='Standard.Tag.1'  flipped False -> True  (verified)
  h=23932 style='Standard.Tag.1'  flipped False -> True  (verified)
  h=23933 style='Standard.Tag.1' already flipped
tag labels found 15; flipped 14, already true 1

Notes

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

No notes yet.