# How to draw text with the dxf-\>writeText()

**URL:** <http://forum.qcad.org/t/how-to-draw-text-with-the-dxf-writetext/443>\
**Category:** dxflib 'How Do I' Questions\
**Created:** [January 13, 2011, 2:04pm UTC](http://forum.qcad.org/t/how-to-draw-text-with-the-dxf-writetext/443 "2011-01-13T14:04:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oleg](http://forum.qcad.org/letter_avatar_proxy/v4/letter/o/ebca7d/32.png) [@Oleg](http://forum.qcad.org/u/Oleg)\
**Post date:** [January 13, 2011, 2:04pm UTC](http://forum.qcad.org/t/how-to-draw-text-with-the-dxf-writetext/443/1 "2011-01-13T14:04:28Z")

</div>

Hello!

I have a question. How to use **dxf-\>writeText(…)**  
In \*.dxf file I draw only one text string with dxf-\>writeText()

AutoCad (2000, 2002, 2004, 2005) error:

> AutoCad 2005  
> The following error was encountered while reading  
> in TEXT starting at line 1518:  
> Unexpected DXF group code: 73  
> Invalid or incomplete DXF input – drawing discarded.

my code:

```plaintext
DL_Codes::version exportVersion = DL_Codes::AC1015;
....
dxf->writeText(
		*dw,
		DL_TextData(
		0.0,//X Coordinate of insertion point
		0.0,//Y Coordinate of insertion point.
		0.0,//Z Coordinate of insertion point.
		100.0,//X Coordinate of alignment point
		0.0,//Y Coordinate of alignment point
		0.0,//Z Coordinate of alignment point
		2.5,//Text height
		1.0,//Relative X scale factor.
		0,//0 = default, 2 = Backwards, 4 = Upside down
		0,//Horizontal justification 0 = Left (default), 1 = Center, 2 = Right,3 = Aligned, 4 = Middle, 5 = Fit 
		0,//Vertical justification. 0 = Baseline (default), 1 = Bottom, 2 = Middle, 3= Top
		"some text",// Text string.
		"Standard",//Style (font). 
		0),//Rotation angle of dimension text away from default orientation.
		DL_Attributes("mainlayer",256,-1,"BYLAYER"));

```

if DL\_Codes::AC1009; all is alright, but not support Layers styles and other (AutoCad 11/12)  
  
  
I use VS2008 with MFC librory

thanks in advance.

_dxflib is great work, really nice code. Thanks the author!_
