AutoCAD.MText
Inherits from AutoCAD.Entity
Description
A class that encapsulates an MText in a DWG file.
This class is a FlexScript wrapper for the AcDbMText class.
Properties
actualHeight | The overall height of the bounding rectangle that surrounds the formatted text. |
actualWidth | The overall width of the bounding rectangle that surrounds the formatted text. |
ascent | The height of the maximum ascender for the first line of the text. |
attachment | A value describing the attachment point for the MText object. |
backgroundColorOn | Gets/sets whether the background color is in use for this object. |
backgroundFillColor | Gets/sets the background color for this object. |
backgroundFillOn | Gets/sets whether background fill is on. |
backgroundScaleFactor | Gets/sets the background scale factor. |
columnAutoHeight | Gets/sets the auto height setting. |
columnCount | Gets/sets the number of columns. |
columnFlowReversed | Gets/sets the flow reversed setting, which determines how columns are added. |
columnGutterWidth | Gets/sets the column gutter width. |
columnWidth | Gets/sets the width of each column. |
contents | Gets/sets the contents of the MText object. |
contentsRTF | Gets/sets the contents in an RTF encoded string of the MText object. |
descent | Gets the height of the maximum descender for the last line of the text. |
direction | Gets/sets a vector representing the X axis ("horizontal") for the text. |
height | Gets/sets the height of this object. |
lineSpacingFactor | Gets/sets the line spacing factor. |
location | Gets/sets the insertion point of the MText object. |
rotation | Gets/sets the rotation in radians. |
showBorders | Gets/sets whether borders are visible. |
text | Gets/sets the contents of the text string with formatting removed. |
textHeight | Gets/sets the nominal text height of the MText object. |
width | Gets/sets the maximum width setting used by the MText object for word wrap formatting. |
Methods
getBoundingPoints | Returns an Array with 4 points defining the bounding box of text as displayed on screen. |
getBoundingPointsByLine | Returns a multidimensional Array of points that represent 4 corners of the boundary box of each line of text. |
getColumnHeight | Gets the height of the specified column. |
removeField | Removes the field specified by the parameter. |
setAttachmentMovingLocation | Changes the attachment of the MText object, like the attachment property can; however, it also moves the location in order to keep the current extent unchanged. |
setColumnHeight | Sets the height of the specified column. |
setDynamicColumns | Sets the column type to kDynamicColumns with specified width, gutter, and auto height setting. |
Details
AutoCAD.MText.actualHeight
readonly double actualHeight
Description
The overall height of the bounding rectangle that surrounds the formatted text.
AutoCAD.MText.actualWidth
readonly double actualWidth
Description
The overall width of the bounding rectangle that surrounds the formatted text.
AutoCAD.MText.ascent
readonly double ascent
Description
The height of the maximum ascender for the first line of the text.
This value can be used with the descent property to help align multiple AcDbMText objects in a table or grid.AutoCAD.MText.attachment
int attachment
Description
A value describing the attachment point for the MText object.
The attachment point value determines how the text will be oriented around the insertion point of the MText object. For example, if the attachment point is kMiddleCenter, then the text body will be displayed such that the insertion point appears at the geometric center of the text body. View the AutoCAD.MText.AttachmentPoint class for what the return values represent.AutoCAD.MText.backgroundColorOn
int backgroundColorOn
Description
Gets/sets whether the background color is in use for this object.
AutoCAD.MText.backgroundFillColor
Color backgroundFillColor
Description
Gets/sets the background color for this object.
AutoCAD.MText.backgroundFillOn
int backgroundFillOn
Description
Gets/sets whether background fill is on.
AutoCAD.MText.backgroundScaleFactor
double backgroundScaleFactor
Description
Gets/sets the background scale factor.
AutoCAD.MText.columnAutoHeight
int columnAutoHeight
Description
Gets/sets the auto height setting.
Specifies whether dynamic columns use the MText height or a per-column user-defined height.AutoCAD.MText.columnFlowReversed
int columnFlowReversed
Description
Gets/sets the flow reversed setting, which determines how columns are added.
AutoCAD.MText.columnGutterWidth
double columnGutterWidth
Description
Gets/sets the column gutter width.
AutoCAD.MText.contents
contents
Description
Gets/sets the contents of the MText object.
Formatting data used for word wrap calculations is removed before the string is copied.AutoCAD.MText.contentsRTF
contentsRTF
Description
Gets/sets the contents in an RTF encoded string of the MText object.
Fonts, colors, tabs, and indents are preserved. Bullets and numbered lists are mapped to hanging paragraphs using the implied setting for tabs and indents.AutoCAD.MText.descent
readonly double descent
Description
Gets the height of the maximum descender for the last line of the text.
This value can be used with the ascent property to help align multiple AcDbMText objects in a table or grid.AutoCAD.MText.direction
Vec3 direction
Description
Gets/sets a vector representing the X axis ("horizontal") for the text.
This direction vector is used to determine the text flow direction.AutoCAD.MText.lineSpacingFactor
double lineSpacingFactor
Description
Gets/sets the line spacing factor.
This should be a value between 0.25 and 4.00.AutoCAD.MText.rotation
double rotation
Description
Gets/sets the rotation in radians.
The angle between the X axis of the OCS for the normal vector of the current AutoCAD editor's UCS and the projection of the MText object's direction vector onto the plane of the AutoCAD editor's current UCS. Positive angles are counterclockwise when looking down the UCS normal towards the UCS origin.AutoCAD.MText.text
readonly text
Description
Gets/sets the contents of the text string with formatting removed.
AutoCAD.MText.textHeight
double textHeight
Description
Gets/sets the nominal text height of the MText object.
AutoCAD.MText.width
double width
Description
Gets/sets the maximum width setting used by the MText object for word wrap formatting.
It is possible that none of the lines resulting from word wrap formatting will reach this width value. Words which exceed this width value will not be broken, but will extend beyond the given width. The AcDbMText::actualWidth() member function returns the actual width of the text, regardless of the maximum width setting.AutoCAD.MText.getBoundingPoints()
Array getBoundingPoints( ) |
Returns
Array | An Array with 4 points. |
Description
Returns an Array with 4 points defining the bounding box of text as displayed on screen.
Index 1: top-left cornerindex 2: top-right corner
index 3: bottom-left corner
index 4: bottom-right corner
AutoCAD.MText.getBoundingPointsByLine()
Array getBoundingPointsByLine( ) |
Returns
Array | a multidimensional Array of points. |
Description
Returns a multidimensional Array of points that represent 4 corners of the boundary box of each line of text.
AutoCAD.MText.getColumnHeight()
double getColumnHeight( int colIndex ) |
Parameters
colIndex | The index of the column to get a height for. |
Returns
double | The height of the specificed column. |
Description
Gets the height of the specified column.
Only valid for dynamic, manual height columns.AutoCAD.MText.removeField()
removeField( AutoCAD.ObjectId objectId ) |
removeField( string fieldName ) |
Parameters
objectId | The id of the object to remove. |
fieldName | The name of the field to remove. |
Description
Removes the field specified by the parameter.
If you supply an AutoCAD.ObjectId, then the field whose object ID matches that ObjectId will be removed from this object's extension dictionary. If you supply a string, then the field with that name will be removed from the object's extension dictionary and the removed field object's ID will be returned.AutoCAD.MText.setAttachmentMovingLocation()
setAttachmentMovingLocation( int attachmentPoint ) |
Parameters
attachmentPoint | The new attachment point to set and move to. |
Description
Changes the attachment of the MText object, like the attachment property can; however, it also moves the location in order to keep the current extent unchanged.
For more details, check the documentation.AutoCAD.MText.setColumnHeight()
setColumnHeight( int colIndex , double newHeight ) |
Parameters
colIndex | The index of the column. |
newHeight | The new height. |
Description
Sets the height of the specified column.
Only valid for dynamic, manual height columns.AutoCAD.MText.setDynamicColumns()
setDynamicColumns( double width , double gutter , int autoHeight ) |
Parameters
width | Input new column width. |
gutter | Input new column gutter. |
autoHeight | Input new auto-height setting. |
Description
Sets the column type to kDynamicColumns with specified width, gutter, and auto height setting.