C3D-SEGHORZ · Make segment labels horizontal done
Set rotation=0 on all SEWER_LINE_TEXT distance/grade labels.
C# payload
// Set all distance/grade segment labels on SEWER_LINE_TEXT to horizontal (rotation 0).
using System;
using Autodesk.AutoCAD.DatabaseServices;
int n = 0;
foreach (ObjectId id in ModelSpace)
{
var e = Tx.GetObject(id, OpenMode.ForRead);
if (!(e is DBText t) || !string.Equals(t.Layer, "SEWER_LINE_TEXT", StringComparison.OrdinalIgnoreCase)) continue;
if (t.Rotation == 0) continue;
var w = (DBText)Tx.GetObject(id, OpenMode.ForWrite);
Log($" '{w.TextString}' rot {w.Rotation * 180 / Math.PI:0.0} -> 0");
w.Rotation = 0;
n++;
}
Log($"DONE. {n} labels set horizontal.");
Result
Log
'80' 15.8%' rot 309.7 -> 0 '159' 12.4%' rot 309.8 -> 0 '359' 1.1%' rot 318.7 -> 0 '80' 0.6%' rot 283.9 -> 0 '155' 0.7%' rot 7.8 -> 0 '20' 0.8%' rot 275.2 -> 0 DONE. 6 labels set horizontal.
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.