[CommandMethod("_test2")]
public static void test2()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
AeccApp.CivilDocument civilDoc = AeccApp.CivilApplication.ActiveDocument;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
AeccDb.ProfileView pv = (AeccDb.ProfileView)trans.GetObject(ed.GetEntity("\npv:").ObjectId, OpenMode.ForRead);
RXClass rx = (RXClass)SystemObjects.ClassDictionary["AeccDbHorizontalGeometryBandLabeling"];
ObjectIdCollection labelGroupIDs = AeccDb.ProfileBandLabelGroup.GetAvailableLabelGroupIds(rx, pv.Id, false);
foreach (ObjectId labelGroupID in labelGroupIDs)
{
AeccDb.ProfileBandLabelGroup labelGroup = (AeccDb.ProfileBandLabelGroup)trans.GetObject(labelGroupID, OpenMode.ForWrite);
IList<AeccDb.LabelGroupSubEntity> labels = labelGroup.SubEntities;
foreach (AeccDb.LabelGroupSubEntity label in labels)
{
Point3d segmentLabelPosition = label.LabelLocation - label.DraggedOffset;
ObjectIdCollection componentIDs = label.GetTextComponentIds();
foreach (ObjectId componentID in componentIDs)
{
AeccDb.Styles.LabelStyleTextComponent component = (AeccDb.Styles.LabelStyleTextComponent)trans.GetObject(componentID, OpenMode.ForRead);
}
}
}
trans.Commit();
}
}