Is it possible to access (get/set) the tag numbers for these labels? I've been looking for a while now and don't see how, just hoping that I've overlooked something. This is for 2010 and/or 2011.
Thanks!
Hi Jeff,
Would it be possible to share a DWG file highlighting these Tag numbers you mentioned here ? I can take a look into the API once I understand what these Tag number you are referring here.
Thanks,
Partha Sarkar
Autodesk
Tag numbers are used when creating Line and Curve tables. They let us do things like label the lines and curves with labels like "L1", "L2", and "C1", then have tables that list the full data for each line or curve.
Hey Jeff,
There are so many places where this is set. The label itself, the drawing setting level, the general settings, parcel (site), and alignment (site). What are you looking to get/set??
Would this help?
Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument.Settings.TagSettings.Creation
I want to select a Tag and be able to determine what is displayed. IOW, I select the tag that says "L1" and I'd like to renumber it to the value in CivilApplication.ActiveDocument.Settings.TagSettings.Renumbering.LinesStartingNumber.
But I need to know what the current number for the label is to determine whether it is a duplicate number.
The ultimate goal is to have a better (for me) EditTagNumbers command.
Interesting...I will have to look into it more when I get a chance but from a cursory review I would have to say "not available".
The only thing I can think of is to try to set override text and see what text is available then but I bet it is just the overridden static text.
You have Partha looking into it also. Are you on ADN?
I will post something if I find anything. Hope you will do the same.
Yeah, the Textoverride is out, because that can still hold the formatting for the Tag without revealing what that tag is.
Nope, not on ADN at this time, someday soon though.
If I figure something out, I will be sure to post it here. Thanks for taking a look, Josh.
Thanks for the DWG !
I did some research, but couldn't see any API available to access the Tag numbers of these labels.
I don't see property exposed to get / set the tag number of Autodesk.Civil.DatabaseServices.Label object.
I was not able to edit them using UI tools (Hope I am not missing any steps to do so).
Thanks,
Partha Sarkar
Autodesk
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, 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(); }
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
I think the more important question is "Is anyone at Autodesk even working on new Civil 3D API features?"