Gets the overriden justification on the specified text component in the CogoPoint label.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0
Syntax
Visual Basic |
---|
Public Function GetLabelTextComponentJustificationOverride ( _
labelComponentId As ObjectId _
) As TextJustificationType |
Visual C++ |
---|
public:
TextJustificationType GetLabelTextComponentJustificationOverride(
ObjectId labelComponentId
) |
Parameters
- labelComponentId
- Type: ObjectId
Examples
CopyC#
1
2
3ObjectId pointId = _civildoc.CogoPoints.Add(new Point3d(100, 100, 100));
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
10ObjectIdCollection textCompIds = cogoPoint.GetLabelTextComponentIds();
11_editor.WriteMessage("\n # components: {0}", textCompIds.Count);
12foreach (ObjectId textCompId in textCompIds)
13{
14
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
26 cogoPoint.ClearLabelTextComponentOverrides(textCompId);
27}
28
29
30cogoPoint.ClearAllLabelTextComponentOverrides();
31
32
33cogoPoint.ResetLabelLocation();
34cogoPoint.ResetLabelRotation();
35cogoPoint.ResetLabel();
CopyVB.NET
1
2
3Dim pointId As ObjectId = _civildoc.CogoPoints.Add(New Point3d(100, 100, 100))
4Dim cogoPoint As CogoPoint = TryCast(pointId.GetObject(OpenMode.ForWrite), CogoPoint)
5cogoPoint.RawDescription = "Example Point"
6cogoPoint.LabelStyleId = _civildoc.Styles.LabelStyles.PointLabelStyles.LabelStyles("Elevation and Description")
7
8
9
10Dim textCompIds As ObjectIdCollection = cogoPoint.GetLabelTextComponentIds()
11_editor.WriteMessage(vbLf & " # components: {0}", textCompIds.Count)
12For Each textCompId As ObjectId In textCompIds
13
14 cogoPoint.SetLabelTextComponentJustificationOverride(textCompId, TextJustificationType.Center)
15 cogoPoint.SetLabelTextComponentOverride(textCompId, "<[Full Description(CP)]>")
16
17 Dim lstc As LabelStyleTextComponent = TryCast(textCompId.GetObject(OpenMode.ForWrite), LabelStyleTextComponent)
18 _editor.WriteMessage(vbLf & " Text Component:{0}", lstc.Name)
19 _editor.WriteMessage(vbLf & " Justification type: {0}", cogoPoint.GetLabelTextComponentJustificationOverride(textCompId))
20 _editor.WriteMessage(vbLf & " Is label text component overriden? {0}", cogoPoint.IsLabelTextComponentOverriden(textCompId))
21 _editor.WriteMessage(vbLf & " Justification override type: {0}", cogoPoint.GetLabelTextComponentJustificationOverride(textCompId))
22 _editor.WriteMessage(vbLf & " Text Contents: {0}", lstc.Text.Contents.Value)
23
24
25 cogoPoint.ClearLabelTextComponentOverrides(textCompId)
26Next
27
28
29cogoPoint.ClearAllLabelTextComponentOverrides()
30
31
32cogoPoint.ResetLabelLocation()
33cogoPoint.ResetLabelRotation()
34cogoPoint.ResetLabel()
Exceptions
Exception | Condition |
---|
System..::..ArgumentException |
Thrown when labelComponentId is not the objectId of the object that composes the text on the sub-entity label.
|
See Also