« CADopia - Adding Hatching | Main | CADopia - Creating Paragraph Text »

Thursday, September 27, 2007

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

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment