CADopia - AddMtext method
Creates an Mtext (multi-line text) object and adds it to the drawing.
Syntax
objectVariable = object.AddMtext(InsertionPoint, Width, Text)
Where:
objectVariable is an Mtext object;
object is one of the ModelSpace or PaperSpace collection objects or a Block object;
InsertionPoint is a Point object representing the location to insert the text;
Width is a double-precision variable or number representing the width of the bounding box;
Text is a String representing the text to appear in the window.
AddMtext method example
Private Sub AddMtextExample()
' This example creates Mtext and adds it to the drawing using the
' AddMtext method.
Dim icadDoc As CADopia.Document
Dim myText As String
Dim mtextObj As CADopia.MText
Dim corner As CADopia.Point
Dim width As Double
Set icadDoc = ActiveDocument
Set corner = Library.CreatePoint(0, 9)
width = 10
myText = "Test string for the AddMtext method"
' Add the mtext Object
Set mtextObj = icadDoc.ModelSpace.AddMText(corner, width, myText)
mtextObj.Update
ThisDocument.ActiveViewport.ZoomExtents
End Sub
Comments