Class CADText
Represents a CAD text entity with various properties and alignment configurations.
Namespace: Evergine.Runtimes.CAD.DataTypes
Assembly: Evergine.Runtimes.CAD.dll
Syntax
public class CADText
Constructors
CADText()
Initializes a new instance of the CADText class with default values.
Declaration
public CADText()
CADText(string, string, XYZ, double, Color, Layer, double)
Initializes a new instance of the CADText class with specified values.
Declaration
public CADText(string entityName, string text, XYZ position, double height, Color color, Layer layer, double rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| string | entityName | The name of the CAD entity. |
| string | text | The text content of the CAD entity. |
| XYZ | position | The position of the CAD text. |
| double | height | The height of the CAD text. |
| Color | color | The color of the CAD text. |
| Layer | layer | The layer of the CAD text. |
| double | rotation | The rotation angle of the CAD text. |
Properties
AttachmentPoint
Gets or sets the attachment point type of the CAD text.
Declaration
public AttachmentPointType AttachmentPoint { get; set; }
Property Value
| Type | Description |
|---|---|
| AttachmentPointType |
BackgroundScale
Gets or sets the background scale of the CAD text.
Declaration
public double BackgroundScale { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Color
Gets or sets the color of the CAD text.
Declaration
public Color Color { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
EntityName
Gets or sets the name of the CAD entity.
Declaration
public string EntityName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Height
Gets or sets the height of the CAD text.
Declaration
public double Height { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
HorizontalAlignment
Gets or sets the horizontal alignment of the CAD text.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| HorizontalAlignment |
HorizontalWidth
Gets or sets the horizontal width of the CAD text.
Declaration
public double HorizontalWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
IsMText
Gets or sets a value indicating whether the text is multi-line text (MText).
Declaration
public bool IsMText { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsMultiline
Gets a value indicating whether the CAD text is multiline.
Declaration
public bool IsMultiline { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Layer
Gets or sets the layer of the CAD text.
Declaration
public Layer Layer { get; set; }
Property Value
| Type | Description |
|---|---|
| Layer |
LineSpacing
Gets or sets the line spacing of the CAD text.
Declaration
public double LineSpacing { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Origin
Gets or sets the origin point of the CAD text.
Declaration
public Vector2 Origin { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Position
Gets or sets the position of the CAD text entity.
Declaration
public XYZ Position { get; set; }
Property Value
| Type | Description |
|---|---|
| XYZ |
RectangleHeight
Gets or sets the rectangle height of the CAD text.
Declaration
public double RectangleHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
RectangleWidth
Gets or sets the rectangle width of the CAD text.
Declaration
public double RectangleWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Rotation
Gets or sets the rotation angle of the CAD text.
Declaration
public double Rotation { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Text
Gets or sets the text content of the CAD entity. Processes the text to remove CAD-specific formatting.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
VerticalAlignment
Gets or sets the vertical alignment of the CAD text.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| VerticalAlignment |
VerticalHeight
Gets or sets the vertical height of the CAD text.
Declaration
public double VerticalHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Methods
GetAlignmentOrigin(HorizontalAlignment, VerticalAlignment)
Gets the origin point for the specified horizontal and vertical alignments.
Declaration
public static Vector2 GetAlignmentOrigin(HorizontalAlignment horizontal, VerticalAlignment vertical)
Parameters
| Type | Name | Description |
|---|---|---|
| HorizontalAlignment | horizontal | The horizontal alignment. |
| VerticalAlignment | vertical | The vertical alignment. |
Returns
| Type | Description |
|---|---|
| Vector2 | The origin point as a Vector2. |
GetAlignmentsOrDefault(AttachmentPointType, out HorizontalAlignment, out VerticalAlignment)
Gets the alignments for the specified attachment point or default alignments if not found.
Declaration
public static bool GetAlignmentsOrDefault(AttachmentPointType attachmentPoint, out HorizontalAlignment horizontalAlignment, out VerticalAlignment verticalAlignment)
Parameters
| Type | Name | Description |
|---|---|---|
| AttachmentPointType | attachmentPoint | The attachment point type. |
| HorizontalAlignment | horizontalAlignment | The horizontal alignment. |
| VerticalAlignment | verticalAlignment | The vertical alignment. |
Returns
| Type | Description |
|---|---|
| bool | True if default alignments are used; otherwise, false. |
GetAlignmentsOrDefault(TextHorizontalAlignment, TextVerticalAlignmentType, out HorizontalAlignment, out VerticalAlignment)
Gets the alignments for the specified horizontal and vertical alignment types or default alignments if not found.
Declaration
public static bool GetAlignmentsOrDefault(TextHorizontalAlignment horizontalAlignment, TextVerticalAlignmentType verticalAlignment, out HorizontalAlignment evergineHorizontal, out VerticalAlignment evergineVertical)
Parameters
| Type | Name | Description |
|---|---|---|
| TextHorizontalAlignment | horizontalAlignment | The horizontal alignment type. |
| TextVerticalAlignmentType | verticalAlignment | The vertical alignment type. |
| HorizontalAlignment | evergineHorizontal | The Evergine horizontal alignment. |
| VerticalAlignment | evergineVertical | The Evergine vertical alignment. |
Returns
| Type | Description |
|---|---|
| bool | True if default alignments are used; otherwise, false. |
GetLineCount()
Gets the number of lines in the CAD text.
Declaration
public int GetLineCount()
Returns
| Type | Description |
|---|---|
| int | The line count. |
ProcessCADText(string)
Processes the CAD text to remove formatting and normalize it.
Declaration
public static string ProcessCADText(string cadText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | cadText | The raw CAD text. |
Returns
| Type | Description |
|---|---|
| string | The processed CAD text. |