Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm pretty sure this is a bug in Civil 3D: I found that when I update the content value in LabelStyleTextComponent , the UI is not immediately updated as it should.
You can use the attached drawing, and the following code to test.
[CommandMethod(nameof(ProfileBandStyleReadOnly))]
public static void ProfileBandStyleReadOnly()
{
Document aDoc = Application.DocumentManager.MdiActiveDocument;
Editor ed = aDoc.Editor;
Database db = aDoc.Database;
using var tr = db.TransactionManager.StartTransaction();
var profileDataId = CivilApplication.ActiveDocument.Styles.BandStyles.ProfileViewProfileDataBandStyles["Vertical Elevations and Stations"];
var profileData = tr.GetObject(profileDataId, OpenMode.ForWrite) as ProfileDataBandStyle;
var titleText = tr.GetObject(profileData.TitleTextLabelStyleId, OpenMode.ForWrite) as LabelStyle;
var allComponents = titleText.GetComponents(LabelStyleComponentType.Text);
var res = tr.GetObject(allComponents[0], OpenMode.ForWrite) as LabelStyleTextComponent;
var theText = res.Text;
var theHeight = theText.Height;
var theContent = theText.Contents;
theContent.Value = @"station\PABC (m) \PDEC";
tr.Commit();
}
To update it, you will have to click Apply on the Label Style Composer, as shown below, then it will be automatically updated.
Note, similar cases:
- https://forums.autodesk.com/t5/civil-3d-customization-forum/some-contentstringformatted-doesn-t-upda...
- https://forums.autodesk.com/t5/civil-3d-customization-forum/edit-the-text-component-editor-value-via...
##########
Ngu Soon Hui
##########
I'm the Benevolent Dictator for Life for MiTS Software. Read more here
I also setup Civil WHIZ in order to share what I learnt about Civil 3D
Ngu Soon Hui
##########
I'm the Benevolent Dictator for Life for MiTS Software. Read more here
I also setup Civil WHIZ in order to share what I learnt about Civil 3D
Solved! Go to Solution.