DXF Group Codes
BLOCKS Section
Blocks in DXF Files

The BLOCKS section of the DXF file contains all the block definitions. It contains the entities that make up the blocks used in the drawing, including anonymous blocks generated by the HATCH command and by associative dimensioning. The format of the entities in this section is identical to those in the ENTITIES section. All entities in the BLOCKS section appear between block and endblk entities. Block and endblk entities appear only in the BLOCKS section. Block definitions are never nested (that is, no block or endblk entity ever appears within another block-endblk pair), although a block definition can contain an insert entity.

External references are written in the DXF file as block definitions, except that they also include a string (group code 1) that specifies the path and file name of the external reference.

The block table handle, along with any xdata and persistent reactors, appears in each block definition immediately following the BLOCK record, which contains all of the specific information that a block table record stores. Therefore, each block definition has the following sequence of records:

The following is an example of the BLOCKS section of a DXF file:

  0
SECTION
  2
BLOCKS


Beginning of BLOCKS section



  0
BLOCK
  5
<handle>
100
AcDbEntity
  8
<layer>
100
AcDbBlockBegin
  2
<block name>
70
<flag>
10
<X value>
20
<Y value>
30
<Z value>
  3
<block name>
  1
<xref path>


Begins each block entry  
(a block entity definition)




















  0
<entity type>
.
. <data>
.


One entry for each entity definition within the block



  0
ENDBLK
  5
<handle>
100
AcDbBlockEnd


End of each block entry
(an endblk entity definition)




  0
ENDSEC


End of BLOCKS section