Click or drag to resize

MText Class

Represents a multiline text entity.
Inheritance Hierarchy

Namespace:  DXFReaderNET.Entities
Assembly:  DXFReaderNET (in DXFReaderNET.dll) Version: 20.10.54
Syntax
public class MText : EntityObject

The MText type exposes the following members.

Constructors
  NameDescription
Public methodMText
Initializes a new instance of the MText class.
Public methodMText(Vector2, Double, Double)
Initializes a new instance of the MText class.
Public methodMText(Vector3, Double, Double)
Initializes a new instance of the MText class.
Public methodMText(String, Vector2, Double, Double)
Initializes a new instance of the MText class.
Public methodMText(String, Vector3, Double, Double)
Initializes a new instance of the MText class.
Public methodMText(Vector2, Double, Double, TextStyle)
Initializes a new instance of the MText class.
Public methodMText(Vector3, Double, Double, TextStyle)
Initializes a new instance of the MText class.
Public methodMText(String, Vector2, Double, Double, TextStyle)
Initializes a new instance of the MText class.
Public methodMText(String, Vector3, Double, Double, TextStyle)
Initializes a new instance of the MText class.
Top
Properties
  NameDescription
Public propertyAttachmentPoint
Gets or sets the text attachment point.
Public propertyCodeName
Gets the dxf entity type string.
(Inherited from DxfObject.)
Public propertyColor
Gets or sets the entity color.
(Inherited from EntityObject.)
Public propertyDirection
Gets or sets the X-axis direction vector in world coordinates.
Public propertyHandle
Gets the handle assigned to the dxf object.
(Inherited from DxfObject.)
Public propertyHeight
Gets or sets the text height.
Public propertyIsVisible
Gets or set the entity visibility.
(Inherited from EntityObject.)
Public propertyLayer
Gets or sets the entity layer.
(Inherited from EntityObject.)
Public propertyLenght
Gets text lenght.
Public propertyLineSpacingFactor
Gets or sets the line spacing factor.
Public propertyLineSpacingStyle
Get or sets the line spacing style.
Public propertyLinetype
Gets or sets the entity line type.
(Inherited from EntityObject.)
Public propertyLinetypeScale
Gets or sets the entity line type scale.
(Inherited from EntityObject.)
Public propertyLineweight
Gets or sets the entity line weight, one unit is always 1/100 mm (default = ByLayer). Valid value are: 0, 5, 9, 13, 15, 18, 20, 25, 30, 35, 40, 50, 53, 60, 70, 80, 90, 100, 106, 120, 140, 158, 200, and 211.
(Inherited from EntityObject.)
Public propertyNormal
Gets or sets the entity normal.
(Inherited from EntityObject.)
Public propertyOwner
Gets the owner of the actual dxf object.
(Inherited from EntityObject.)
Public propertyParagraphHeightFactor
Gets or sets the paragraph height factor.
Public propertyPosition
Gets or sets the Text position in world coordinates.
Public propertyReactors
Gets or sets the list of dxf objects that has been attached to this entity.
(Inherited from EntityObject.)
Public propertyRectangleWidth
Gets or sets the text reference rectangle width.
Public propertyRotation
Gets or sets the text rotation in degrees.
Public propertyStyle
Gets or sets the text style.
Public propertyTransparency
Gets or sets layer transparency (default: ByLayer).
(Inherited from EntityObject.)
Public propertyType
Gets the entity type.
(Inherited from EntityObject.)
Public propertyValue
Gets or sets the raw text string.
Public propertyXData
Gets or sets the entity extended data.
(Inherited from EntityObject.)
Top
Methods
  NameDescription
Public methodClone
Creates a new MText that is a copy of the current instance.
(Overrides EntityObjectClone.)
Public methodEndParagraph
Ends the actual paragraph (adds the end paragraph code and the paragraph height factor).
Public methodPlainText
Obtains the MText text value without the formatting codes, control characters like tab '\t' will be preserved in the result, the new paragraph command "\P" will be converted to new line feed '\r\n'.
Public methodToString
Converts the value of this instance to its equivalent string representation.
(Inherited from EntityObject.)
Public methodWrite(String)
Adds the text to the existing paragraph.
Public methodWrite(String, MTextFormattingOptions)
Adds the text to the existing paragraph.
Top
Remarks
Formatting codes for MText, you can use them directly while setting the text value or use the Write() method.
\L Start underline
\l Stop underline
\O Start overstrike
\o Stop overstrike
\K Start strike-through
\k Stop strike-through
\P New paragraph (new line)
\pxi Control codes for bullets, numbered paragraphs and columns
\X Paragraph wrap on the dimension line (only in dimensions)
\Q Slanting (obliquing) text by angle - e.g. \Q30;
\H Text height - e.g. \H3x;
\W Text width - e.g. \W0.8x;
\F Font selection

e.g. \Fgdt;o - GDT-tolerance
e.g. \Fkroeger|b0|i0|c238|p10; - font Kroeger, non-bold, non-italic, code page 238, pitch 10

\S Stacking, fractions

e.g. \SA^B;
A
B
e.g. \SX/Y
X
-
Y
e.g. \S1#4;
1/4

\A Alignment
\A0; = bottom
\A1; = center
\A2; = top

\C Color change
\C1; = red
\C2; = yellow
\C3; = green
\C4; = cyan
\C5; = blue
\C6; = magenta
\C7; = white

\T Tracking, char.spacing - e.g. \T2;
\~ Non-wrapping space, hard space
{} Braces - define the text area influenced by the code
\ Escape character - e.g. \\ = "\", \{ = "{"

Codes and braces can be nested up to 8 levels deep.
See Also