The CLASSES section contains CLASS definitions which are only important for Autodesk products, some DXF entities require a class definition or AutoCAD will not open the DXF file.

The CLASSES sections was introduced with DXF AC1015 (AutoCAD Release R13).

See also

DXF Reference: About the DXF CLASSES Section

The CLASSES section in DXF files holds the information for application-defined classes whose instances appear in the BLOCKS, ENTITIES, and OBJECTS sections of the database. It is assumed that a class definition is permanently fixed in the class hierarchy. All fields are required.

Update 2019-03-03:

Class names are not unique, Autodesk Architectural Desktop 2007 uses the same name, but with different CPP class names in the CLASS section, so storing classes in a dictionary by name as key caused loss of class entries in ezdxf, using a tuple of (name, cpp_class_name) as storage key solved the problem.

CLASS Entities

See also

DXF Reference: Group Codes for the CLASS entity

CLASS entities have no handle and therefore ezdxf does not store the CLASS entity in the drawing entities database!

2           <<< begin CLASSES section
0           <<< first CLASS entity
1           <<< class DXF entity name; THIS ENTRY IS MAYBE NOT UNIQUE
2           <<< C++ class name; always unique
3           <<< application name
ObjectDBX Classes
90          <<< proxy capabilities flags
91          <<< instance counter for custom class, since DXF version AC1018 (R2004)
0           <<< no problem if the counter is wrong, AutoCAD doesn't care about
280         <<< was-a-proxy flag. Set to 1 if class was not loaded when this DXF file was created, and 0 otherwise
281         <<< is-an-entity flag. Set to 1 if class reside in the BLOCKS or ENTITIES section. If 0, instances may appear only in the OBJECTS section
0           <<< second CLASS entity
0           <<< end of CLASSES section