C3D-0092 · READ-ONLY: capture the DELTA OFF curve label style in full [READ-DELTA-OFF] error
Dumps every text component of the user DELTA OFF parcel curve label style with contents, height, colour, attachment, offsets, rotation and text style, plus the leader settings, so the style can be rebuilt in another drawing. No changes.
C# payload
// READ-ONLY. Capture the user's "DELTA OFF" parcel curve label style completely, so it can be
// rebuilt in another drawing once that one is active. Dump EVERY text component with all its
// settings, plus the leader and general properties. Nothing is modified.
var civil = CivilApplication.ActiveDocument;
Func<Func<string>, string> safe = f => { try { return f(); } catch (System.Exception ex) { return "<" + ex.GetType().Name + ">"; } };
Log("drawing: " + Db.Filename);
Log("");
foreach (ObjectId sid in civil.Styles.LabelStyles.ParcelLabelStyles.CurveLabelStyles) {
var s = Tx.GetObject(sid, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.LabelStyle;
if (s == null || s.IsErased) continue;
string nm = safe(() => s.Name);
if (nm.ToUpper().IndexOf("DELTA OFF") < 0) continue;
Log("=== STYLE \"" + nm + "\" ===");
Log(" Description " + safe(() => s.Description));
foreach (ObjectId cid in s.GetComponents(Autodesk.Civil.DatabaseServices.Styles.LabelStyleComponentType.Text)) {
var c = Tx.GetObject(cid, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.LabelStyleTextComponent;
if (c == null) continue;
Log("");
Log(" COMPONENT \"" + safe(() => c.Name) + "\"");
Log(" Visible " + safe(() => c.General.Visible.Value.ToString()));
Log(" Anchor " + safe(() => c.General.AnchorComponent.Value));
Log(" AnchorPt " + safe(() => c.General.AnchorLocation.Value.ToString()));
Log(" CONTENTS " + safe(() => c.Text.Contents.Value));
Log(" Height " + safe(() => c.Text.Height.Value.ToString()));
Log(" Color " + safe(() => c.Text.Color.Value.ToString()));
Log(" Attachment " + safe(() => c.Text.Attachment.Value.ToString()));
Log(" Justify " + safe(() => c.Text.Justification.Value.ToString()));
Log(" XOffset " + safe(() => c.Text.XOffset.Value.ToString()));
Log(" YOffset " + safe(() => c.Text.YOffset.Value.ToString()));
Log(" Rotation " + safe(() => c.Text.Rotation.Value.ToString()));
Log(" TextStyle " + safe(() => c.Text.TextStyle.Value.ToString()));
Log(" MaxWidth " + safe(() => c.Text.MaxWidth.Value.ToString()));
}
Log("");
Log(" -- leader --");
Log(" Visibility " + safe(() => s.Properties.Leader.Visibility.Value.ToString()));
Log(" ArrowheadStyle " + safe(() => s.Properties.Leader.ArrowheadStyle.Value));
Log(" ArrowheadSize " + safe(() => s.Properties.Leader.ArrowheadSize.Value.ToString()));
Log(" Shape " + safe(() => s.Properties.Leader.Shape.Value.ToString()));
Log(" Color " + safe(() => s.Properties.Leader.Color.Value.ToString()));
Log(" Lineweight " + safe(() => s.Properties.Leader.Lineweight.Value.ToString()));
Log(" Linetype " + safe(() => s.Properties.Leader.Linetype.Value.ToString()));
}
Result
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.