Creates a text object and adds it to the drawing.
Syntax
objectVariable = object.AddText(TextString, InsertionPoint, Height)
Where:
objectVariable is an Mtext object;
object is one of the ModelSpace or PaperSpace collection objects or a Block object;
TextString is a String representing the text to place in the drawing;
InsertionPoint is a Point object representing the location to insert the text;
Height is a double-precision variable or number representing the height of the text.
AddText method example
Private Sub AddText_Example()
' This example creates text and adds it to the drawing using the
' AddText method. It then zooms to the center of the drawing.
Dim icadDoc As CADopia.Document
Dim myText As String
Dim mtextObj As CADopia.Text
Dim insPt As CADopia.Point
Dim height As Double
Set icadDoc = ActiveDocument
Set insPt = Library.CreatePoint(0, 9)
height = 5
myText = "Test string for the AddText method"
' Add the Text object
Set mtextObj = icadDoc.ModelSpace.AddText(myText, insPt, height)
mtextObj.Update
ThisDocument.ActiveViewport.ZoomCenter insPt, 20
End Sub
Comments