C3D-0083 · READ-ONLY: read inside the two parcel curve label styles [CURVE-STYLE-INSIDE2] done
Reads the text components and their content templates, heights, colours and offsets inside Delta over Length and Radius and Standard, and reflects the leader type real property surface rather than guessing member names again. No changes.
C# payload
// READ-ONLY. Look INSIDE the two parcel curve label styles. The style NAME does not have to
// describe what it emits - "Delta over Length and Radius" may have been edited to produce the
// ARC / CHD / bearing / RAD format. Read the actual text components and the leader settings.
// Nothing is modified.
var civil = CivilApplication.ActiveDocument;
Func<Func<string>, string> safe = f => { try { return f(); } catch (System.Exception ex) { return "<" + ex.GetType().Name + ">"; } };
foreach (ObjectId sid in civil.Styles.LabelStyles.ParcelLabelStyles.CurveLabelStyles) {
var st = Tx.GetObject(sid, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.LabelStyle;
if (st == null) continue;
Log("");
Log("=== STYLE \"" + safe(() => st.Name) + "\" ===");
// every text component and its content template - this is the format itself
try {
var comps = st.GetComponents(Autodesk.Civil.DatabaseServices.Styles.LabelStyleComponentType.Text);
Log(" text components: " + comps.Count);
foreach (ObjectId cid in comps) {
var c = Tx.GetObject(cid, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.LabelStyleTextComponent;
if (c == null) continue;
Log(" * \"" + safe(() => c.Name) + "\"");
Log(" Contents " + safe(() => c.Text.Contents.Value));
Log(" Height " + safe(() => c.Text.Height.Value.ToString()));
Log(" Color " + safe(() => c.Text.Color.Value.ToString()));
Log(" Attach " + safe(() => c.Text.Attachment.Value.ToString()));
Log(" XOffset " + safe(() => c.Text.XOffset.Value.ToString()));
Log(" YOffset " + safe(() => c.Text.YOffset.Value.ToString()));
}
} catch (System.Exception ex) { Log(" components: " + ex.Message); }
// leader: I have guessed BaseLeader's members wrong once already - reflect the real
// surface instead of guessing again.
try {
var lt = st.Properties.Leader.GetType();
Log(" -- leader (" + lt.Name + ") --");
var ns = new List<string>();
foreach (var pr in lt.GetProperties()) ns.Add(" " + pr.PropertyType.Name + " " + pr.Name);
ns.Sort();
foreach (var x in ns) Log(x);
} catch (System.Exception ex) { Log(" leader: " + ex.Message); }
}
Result
Log
=== STYLE "Delta over Length and Radius" ===
text components: 3
* "Table Tag"
Contents C<[Parcel Curve Number]>
Height 0.008333333333333333
Color BYLAYER
Attach BottomCenter
XOffset 0
YOffset 0.0020833333333333333
* "Distance & Radius"
Contents ARC-<[Segment Length(Uft|P2|RN|AP|Sn|OF)]>'\PCHD-<[Segment Chord Length(Uft|P2|RN|AP|GC|UN|Sn|OF)]>'\P<[Segment Chord Direction(Udeg|FDMSdSp|MB|P4|RN|DSn|CU|AP|EN|DZY|OF)]>\PRAD-<[Segment Radius(Uft|P2|RN|AP|Sn|OF)]>'
Height 0.008333333333333333
Color BYLAYER
Attach BottomCenter
XOffset 0
YOffset -0.0020833333333333333
* "Delta"
Contents {\fSimplex|b0|i0|c161|p2;\U+0394\fSimplex|b0|i0|c0|p0;=}<[Segment Delta Angle(Udeg|FD|P2|RN|AP|OF)]>
Height 0.008333333333333333
Color BYLAYER
Attach TopCenter
XOffset 0
YOffset 0.0020833333333333333
-- leader (BaseLeader) --
PropertyBoolean Visibility
PropertyColor Color
PropertyDouble ArrowheadSize
PropertyEnum`1 Lineweight
PropertyEnum`1 Shape
PropertyLinetype Linetype
PropertyString ArrowheadStyle
=== STYLE "Standard" ===
text components: 2
* "Table Tag"
Contents C<[Parcel Curve Number(Sn|GC|UN)]>
Height 0.008333333333333333
Color BYLAYER
Attach BottomCenter
XOffset 0
YOffset 0.0020833333333333333
* "Distance and Radius"
Contents L=<[Segment Length(Uft|P3|RN|Sn|OF|AP|GC|UN)]>, R=<[Segment Radius(Uft|P3|RN|Sn|OF|AP|GC|UN)]>
Height 0.008333333333333333
Color BYLAYER
Attach TopCenter
XOffset 0
YOffset -0.0020833333333333333
-- leader (BaseLeader) --
PropertyBoolean Visibility
PropertyColor Color
PropertyDouble ArrowheadSize
PropertyEnum`1 Lineweight
PropertyEnum`1 Shape
PropertyLinetype Linetype
PropertyString ArrowheadStyleNotes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.