CogoPointClearLabelTextComponentOverrides Method

Clears the text component overrides on the specified text component in the CogoPoint label.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public void ClearLabelTextComponentOverrides(
	ObjectId labelComponentId
)

Parameters

labelComponentId  ObjectId
The ObjectId of the text component to clear.
Exceptions
ExceptionCondition
ArgumentException Thrown when labelComponentId is not the objectId of the object that composes the text on the sub-entity label.
Example
 1// Create a COGO Point to demonstrate its methods.
 2// 
 3ObjectId pointId = _civildoc.CogoPoints.Add(new Point3d(100, 100, 100), false);
 4CogoPoint cogoPoint = pointId.GetObject(OpenMode.ForWrite) as CogoPoint;
 5cogoPoint.RawDescription = "Example Point";
 6cogoPoint.LabelStyleId = _civildoc.Styles.LabelStyles.PointLabelStyles.LabelStyles["Elevation and Description"];
 7
 8
 9// Get text components
10ObjectIdCollection textCompIds = cogoPoint.GetLabelTextComponentIds();
11_editor.WriteMessage("\n # components: {0}", textCompIds.Count);
12foreach (ObjectId textCompId in textCompIds)
13{
14    // Set overrides:
15    cogoPoint.SetLabelTextComponentJustificationOverride(textCompId, TextJustificationType.Center);
16    cogoPoint.SetLabelTextComponentOverride(textCompId, "<[Full Description(CP)]>");
17
18    LabelStyleTextComponent lstc = textCompId.GetObject(OpenMode.ForWrite) as LabelStyleTextComponent;
19    _editor.WriteMessage("\n Text Component:{0}", lstc.Name);
20    _editor.WriteMessage("\n Justification type: {0}", cogoPoint.GetLabelTextComponentJustificationOverride(textCompId));
21    _editor.WriteMessage("\n Is label text component overriden? {0}", cogoPoint.IsLabelTextComponentOverriden(textCompId));
22    _editor.WriteMessage("\n Justification override type: {0}", cogoPoint.GetLabelTextComponentJustificationOverride(textCompId));
23    _editor.WriteMessage("\n Text Contents: {0}", lstc.Text.Contents.Value);
24
25    // clear overrides for this ID
26    cogoPoint.ClearLabelTextComponentOverrides(textCompId);
27}
28
29// You can clear all the overrides without having to iterate the collection like this:
30cogoPoint.ClearAllLabelTextComponentOverrides();
31
32// Reset the label location, rotation, contents:
33cogoPoint.ResetLabelLocation();
34cogoPoint.ResetLabelRotation();
35cogoPoint.ResetLabel();
See Also