AutoCAD Civil 3D Customization

AutoCAD Civil 3D Customization

Reply
Mentor
tyronebk
Posts: 176
Registered: ‎08-17-2007
Message 11 of 15 (161 Views)

Re: Line/Curve/Spiral Table Tag numbering

03-10-2014 05:31 PM in reply to: Jeff_M
Was access to the segment number ever exposed through the API? It doesn't look like it was but I might be overlooking something. TIA.
*Expert Elite*
Jeff_M
Posts: 4,385
Registered: ‎07-22-2003
Message 12 of 15 (155 Views)

Re: Line/Curve/Spiral Table Tag numbering

03-10-2014 06:26 PM in reply to: tyronebk
Not as far as I can tell. Still wishing...
Jeff_M, also a frequent Swamper
ADN Support Specialist
Partha.Sarkar
Posts: 543
Registered: ‎06-09-2009
Message 13 of 15 (145 Views)

Re: Line/Curve/Spiral Table Tag numbering

03-11-2014 03:04 AM in reply to: tyronebk

Hi Jeff and All,

 

I revisted this quickly and I can confirm you that now we can access the Label style text component.

Could you try the following approach ? Please check this blog post in our IM DevBlog -

 

http://adndevblog.typepad.com/infrastructure/2013/04/get-cogopoint-label-text.html

 

Does it help ?

 

Thanks,



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

*Expert Elite*
Jeff_M
Posts: 4,385
Registered: ‎07-22-2003
Message 14 of 15 (138 Views)

Re: Line/Curve/Spiral Table Tag numbering

03-11-2014 06:53 AM in reply to: Partha.Sarkar

Partha, we've been able to get the Override for sometime npow. However, as Augusto notes in the blog, "Unfortunately this will output the format of the text, as shown on the Text Component Editor, not the actual value."

 

I can determine if the Label being used is in Tag or Label mode, but not what the actual label reads...and no way to edit the Numbers even if we could read it.

 

            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                GeneralSegmentLabel lbl = (GeneralSegmentLabel)pselect.ObjectId.GetObject(OpenMode.ForRead);
                LabelStyle style = (LabelStyle)lbl.LineLabelStyleId.GetObject(OpenMode.ForRead);
                if (style.Properties.Label.DisplayMode.Value == LabelDisplayModeType.Tag)
                {
                    LabelStyleTextComponent tag = null;
                    foreach (ObjectId tcId in lbl.GetTextComponentIds())
                    {
                        LabelStyleTextComponent tc = (LabelStyleTextComponent)tcId.GetObject(OpenMode.ForRead);
                        if (tc.Name == "Table Tag")
                        {
                            tag = tc;
                            break;
                        }
                    }
                    string contents = lbl.GetTextComponentOverride(tag.ObjectId);
                }
                tr.Commit();
            }

 

 

Jeff_M, also a frequent Swamper
ADN Support Specialist
Partha.Sarkar
Posts: 543
Registered: ‎06-09-2009
Message 15 of 15 (125 Views)

Re: Line/Curve/Spiral Table Tag numbering

03-12-2014 07:10 AM in reply to: Jeff_M

Ah...yes, I am aware of this and I had already logged an internal API wish list - ".NET API to Access Label Text value".

 

Thanks,

Partha



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.