CADopia - Creating Single-Line Text
Single-line text is an individual line of text contained in one Text object. It is useful for labels and short notes. If you have longer notes that may exceed one line, use paragraph text (Mtext). To create single-line text, use the AddText method. In either case, you need to provide three values as input: the text string, the insertion point, and the height of the text.
The text string is the text you wish displayed - entered as either a string variable or as a literal string enclosed in quotes. The insertion point is a Point object indicating the coordinate location for placing the text. The text height is a real number defining the height of the upper-case characters in drawing units.
AddText method
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.
Comments