Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Profile Data Band Label Group

2 REPLIES 2
Reply
Message 1 of 3
Civil3DReminders
697 Views, 2 Replies

Profile Data Band Label Group

So I've got a collection of the LabelGroupSubEntity in the ProfileDataBandLabelGroup. I need to replace some values inside them based on what Vertical Geometry Point they are labeling. Is there an easy way to determine what station value it is labeling?

 

Christopher 

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: Civil3DReminders

Will this give you what you need?

 

            CivilDocument civdoc = CivilApplication.ActiveDocument;
            using (Transaction tr = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
            {
                Alignment oAlign = (Alignment)civdoc.GetAlignmentIds()[0].GetObject(OpenMode.ForRead);
                ProfileView pv = (ProfileView)oAlign.GetProfileViewIds()[0].GetObject(OpenMode.ForWrite);
                RXClass profDataBandLabelGroupRXClass = SystemObjects.ClassDictionary["AeccDbProfileDataBandLabeling"] as RXClass;
                ObjectIdCollection profBandLabelsObjIdColl = ProfileBandLabelGroup.GetAvailableLabelGroups(profDataBandLabelGroupRXClass, pv.ObjectId, false);
                if (profBandLabelsObjIdColl.Count > 0)
                {
                    ProfileBandLabelGroup grp = (ProfileBandLabelGroup)profBandLabelsObjIdColl[0].GetObject(OpenMode.ForRead);
                    if (grp.GetType() == typeof(ProfileDataBandLabelGroup))
                    {
                        foreach (LabelGroupSubEntity subent in grp.SubEntities)
                        {
                            double station = Double.NaN;
                            double elevation = Double.NaN;
                            pv.FindStationAndElevationAtXY(subent.AnchorInfo.Location.X, subent.AnchorInfo.Location.Y, ref station, ref elevation);
                        }
                    }
                }
                tr.Commit();
            }

 

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3
Civil3DReminders
in reply to: Jeff_M

Yes and no. It works if my labels are not staggered. Unfortunatley my labels are staggered so they won't be a the point being labeled.

 

Christopher

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report