Click or drag to resize

MText Class

imbVeles Framework: imbSCI | imbACE | imbNLP | imbWEM | imbWBI
Represents a multiline text entity.
Inheritance Hierarchy

Namespace:  netDxf.Entities
Assembly:  netDXF.Standard (in netDXF.Standard.dll) Version: 2.1.1
Syntax
C#
public class MText : EntityObject
Request Example View Source

The MText type exposes the following members.

Constructors
  NameDescription
Public methodMText
Initializes a new instance of the MText class.
Public methodMText(String)
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 object name.
(Inherited from DxfObject.)
Public propertyColor
Gets or sets the entity color.
(Inherited from EntityObject.)
Public propertyDrawingDirection
Get or sets the text drawing direction.
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 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).
(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 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 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 methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnLayerChangedEvent (Inherited from EntityObject.)
Protected methodOnLinetypeChangedEvent (Inherited from EntityObject.)
Protected methodOnTextStyleChangedEvent
Protected methodOnXDataAddAppRegEvent (Inherited from EntityObject.)
Protected methodOnXDataRemoveAppRegEvent (Inherited from EntityObject.)
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
Events
  NameDescription
Public eventLayerChanged (Inherited from EntityObject.)
Public eventLinetypeChanged (Inherited from EntityObject.)
Public eventTextStyleChanged
Public eventXDataAddAppReg (Inherited from EntityObject.)
Public eventXDataRemoveAppReg (Inherited from EntityObject.)
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