ReadOnlyText
Namespace: Digi21.DigiNG.Entities
Assembly: Digi21.DigiNG
Read-only text: a string, insertion coordinate, height, rotation, orientation in space and justification.
public class ReadOnlyText : Entity, ISnapable
Inheritance: Object → Entity → ReadOnlyText
Derived types: Text
Implements: ISnapable and, through inheritance, IWindow3D, ICloneable and IDisposable.
The class has no public constructors. Drawing files return text they read with this type, and IDrawingFile.Add(Text) returns the added text with this type. To obtain modifiable text, use Clone or create a Text.
Other members (codes, colors, attributes, minimum and maximum coordinates, Dispose…) are inherited from Entity.
Properties
| Member | Description |
|---|---|
string Txt { get; } |
Text string. |
Point3D Coordinate { get; } |
Insertion coordinate. |
double TextHeight { get; } |
Text height. |
double Rotation { get; } |
Rotation, in degrees, counterclockwise from the X axis, around the world Z axis. |
Quaternion Orientation { get; } |
Orientation in space: a quaternion applied before Rotation, in the text's local coordinate system. Quaternion.Identity leaves the text in the XY plane. |
TextJustification Justification { get; } |
Insertion point position relative to the text. |
Methods
| Member | Description |
|---|---|
Text Clone() |
Returns a modifiable copy of the text, without a drawing file. |
Point3D Distance(Point3D coordinate) |
Returns Coordinate - coordinate: the vector from coordinate to the insertion point. Does not account for the string's extent. |
double NearestVertex(Point3D coordinate, out Point3D nearestVertex, out int vertex) |
Returns the insertion point in nearestVertex and 0 in vertex. Returns the XY plane distance between coordinate and the insertion point. |
double NearestSegment(Point3D coordinate, out Point3D calculatedCoordinate, out int segment) |
Same result as NearestVertex: calculatedCoordinate is the insertion point, segment is 0, and the return value is the XY plane distance. |
string ToString() |
Returns the entity type, minimum and maximum coordinates, codes, coordinate, rotation, height and justification in the Digi3D.AI interface language. If the text has an orientation other than Quaternion.Identity, adds the orientation. |
Example
The Text example reads Txt and Justification from the ReadOnlyText returned by BinDouble.Add.