Search code examples
autocaddxf

Adding text to a dxf file


I'm trying to add a label to my dxf file using TEXT entity, the problem is that I'm not able to change text style (group 7) and thickness (group 39) ;it always appears in the standard style and thickness. When I try to use AcdbText entity my file doesn't open at all in Autocad 2015. My dxf file:

0
SECTION
  2
HEADER
  9
$ACADVER
  1
AC1009
  9
$CECOLOR
 62
   256
  9
$CELTYPE
  6
DUPLAN
  9
$CLAYER
  8
0
  9
$ELEVATION
 40
0.000
  9
$EXTMAX
 10
636293.769999
 20
505977.195001
  9
$EXTMIN
 10
636165.769999
 20
505769.195001
  9
$INSBASE
 10
0.0
 20
0.0
 30
0.0
  9
$LIMCHECK
 70
     1
  9
$LIMMAX
 10
636293.769999
 20
505977.195001
  9
$LIMMIN
 10
636165.769999
 20
505769.195001
  9
$LUNITS
 70
     2
  9
$LUPREC
 70
     2
  0
ENDSEC
  0
SECTION
  2
TABLES
  0
TABLE
  2
STYLE
 70
     1
  0
STYLE
  2
ROMANS
 70
     0
 40
0.000
 41
1.000
 50
0.000
 71
     0
 42
1.000
  3
xxx.txt
  4
yyy.txt
  0
ENDTAB
  0
TABLE
  2
LTYPE
 70
     1
  0
LTYPE
  2
CONTINUE
 70
     0
  3

 72
    65
 73
     0
 40
0.000
  0
ENDTAB
  0
TABLE
  2
LAYER
 70
     2
  0
LAYER
  2
LAYERX
 70
     0
 62
   131
  6
CONTINUE
  0
ENDTAB
  0
ENDSEC
  0
SECTION
  2
ENTITIES
  0
POLYLINE
  8
LAYERX
 66
     1
 10
0.0
 20
0.0
 70
     9
  0
VERTEX
  8
LAYERX
 10
636166
 20
505769
 70
    32
  0
VERTEX
  8
LAYERX
 10
636294
 20
505769
 70
    32
  0
VERTEX
  8
LAYERX
 10
636294
 20
505977
 70
    32
  0
VERTEX
  8
LAYERX
 10
636166
 20
505977
 70
    32
  0
VERTEX
  8
LAYERX
 10
636166
 20
505769
 70
    32
  0
SEQEND
  0
POLYLINE
  8
LAYERX
 66
     1
 10
0.0
 20
0.0
 70
     9
  0
VERTEX
  8
LAYERX
 10
636234
 20
505904
 70
    32
  0
VERTEX
  8
LAYERX
 10
636255
 20
505890
 70
    32
  0
VERTEX
  8
LAYERX
 10
636232
 20
505866
 70
    32
  0
VERTEX
  8
LAYERX
 10
636205
 20
505843
 70
    32
  0
VERTEX
  8
LAYERX
 10
636209
 20
505880
 70
    32
  0
VERTEX
  8
LAYERX
 10
636212
 20
505885
 70
    32
  0
VERTEX
  8
LAYERX
 10
636234
 20
505904
 70
    32
  0
SEQEND
  0
TEXT
  8
label
 39
20
 10
636212
 20
505885
 40
9.28
 41
1
  1
Label
  7
ROMANS
  0
ENDSEC
  0
EOF  

Result :

enter image description here


Solution

  • Your style entry is incomplete in the DXF file for ROMANS.

    It should be:

      0
    STYLE
      2
    ROMANS
     70
         0
     40
    0.0
     41
    1.0
     50
    0.0
     71
         0
     42
    2.5
      3
    romans.shx
      4
    
      0
    

    Here is the details about the STYLE entry:

    Style properties