LabelGroup group = (LabelGroup)baseLabel;
foreach (LabelGroupSubEntity subEntity in group.SubEntities)
{
ObjectIdCollection textComponentIds = subEntity.GetTextComponentIds();
textComponentIds = subEntity.GetTextComponentIds();
if (textComponentIds.Count > 0)
{
foreach(ObjectId id in textComponentIds)
{
LabelStyleTextComponent lsc = (LabelStyleTextComponent)id.GetObject(OpenMode.ForWrite);
if (lsc.Name == "добавкаНАЧАЛОкривой" || lsc.Name == "ДобавкаНачалаКонца")
{
double st = 0;
double off = 0;
al.StationOffset(subEntity.LabelLocation.X,subEntity.LabelLocation.Y,0.01,ref st,ref off);
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(st+" "+al.GetStationStringWithEquations(st)+"\n");
subEntity.SetTextComponentOverride(id, _getNearestPoint(Double.Parse(al.GetStationStringWithEquations(st).Replace("+", "")), station_map));
}
}
}
else
{
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("Label: "
+ subEntity.Parent.GetRXClass().DxfName + " doesn't have any text component to override! "
+ "This label will be ignored for the current action.\n");
break;
}
}