foreach(ObjectId oid in alignment.GetSampleLineGroupIds())
...
ObjectIdCollection idColl = Autodesk.Civil.DatabaseServices.SampleLineLabelGroup.GetAvailableLabelGroupIds(oid);
foreach (ObjectId sId in idColl)
{
SampleLineLabelGroup sg = trans.GetObject(sId, OpenMode.ForWrite) as SampleLineLabelGroup;
IList<LabelGroupSubEntity> labels = sg.SubEntities;
foreach (LabelGroupSubEntity label in labels)
{
ObjectIdCollection componentIDs = label.GetTextComponentIds();
foreach (ObjectId componentID in componentIDs)
{
LabelStyleTextComponent component = (LabelStyleTextComponent)trans.GetObject(componentID, OpenMode.ForRead);
label.SetTextComponentOverride(componentID, test_str);
}
}
}