Enter Text from Draw
- Last UpdatedApr 27, 2023
- 2 minute read
Text for use with the Draw 2D drafting facilities takes the form of TEXP elements that must be created (as NOTE, VNOT or SYTM members) before the text itself can be input. The text itself is input as the BTEX attribute of the TEXP, being positioned (by default) at the default drafting point. The text can be repositioned by an AT @ command. The text size probably needs to be increased, which is done by setting the CHEI (character height) or LHEI (letter height) attribute to a suitable value.
A TEXP has attributes governing its orientation (ADEG), text colour (TXCOLOUR), font (FONT), horizontal justification (JUST), character/letter height and spacing (CHEI/LHEI, CSPA) and line spacing and alignment (LSPA, ALIG). All these attributes are the same as those for Label Text. Refer to Labels for further information.
In addition to the facilities outlined, TEXP elements which are NOTE/VNOT members can incorporate intelligent text codes. Refer to Intelligent Text for further information. TEXP elements that are SYTM members can also incorporate intelligent text codes, but these are only expanded when the SYTM is referenced by a SLAB.
The command
Q EXTENT BTEX
can be used to give the extent of the BTEX text string. Four pairs of coordinates are output, giving the coordinates of the corners of the rectangular area occupied by the text in Top-left, Top-right, Bottom-right, Bottom left order with respect to the direction of the drawn text string.
These coordinate pairs can be used to align another string of text with the queried text string. The pair of coordinates to be used depends on the Justification and Alignment attributes of the text to be aligned. Thus if JUSTIFICATION LEFT, ALIGNMENT TBODY is being used, then the position of the next line of text is given by the fourth pair of coordinates, whatever the text orientation.