Complete rewrite of the entity system by keeping the high level interface unchanged, changes for users should be minimal, but there are some bigger changes that could impact users too.
Entities are no more stored as tag lists, instead each DXF entity is represented by a proper Python object like the wrapper classes in previous ezdxf versions, by overhauling the complete system I decided to use a unified entity system for ALL DXF versions.
Advantage is a faster and easier internal processing, and you can save as any DXF version you want by the cost of losing data and attributes if you choose to save in an older DXF version, because ezdxf is still not a DXF converter or CAD application. Otherwise saving an older DXF versions as a newer DXF version should work properly e.g. open a DXF R12 and save it as DXF R2018.
Creating new drawings by
exdxf.new() is about 6x faster than before, because no templates from file system are needed
anymore, new drawings are build from scratch in memory.
Disadvantage, ezdxf has to interpret all group codes of supported entities and Autodesk do not document all group codes in the official DXF reference, this unknown group codes will be lost by saving a modified DXF drawing, unsupported and unknown entities are still stored and preserved as dumb tag lists (unsupported is my term for documented entities, just stored for preservation). ezdxf logs unknown tags, but I don't have the time and will to research the functionality of these unknown tags. This new entity system also causes a little time penalty for loading and saving DXF files, the actual loading process is optimized for the old entity system and could be optimized for the new entity system later, but the penalty is only ~1.5x to 2x and is only noticeable at really large files (>5MB).
CAUTION: SOME DATA MAYBE LOST BY MODIFYING EXISTING DXF FILES.
Renamed all DXF attributes which represent a handle to clarify the type of the attribute, except for
owner all handle attributes have a "_handle" suffix.
DXFEntity class is still the base class of all DXF entities, but some major changes had be done, mostly
important for developers which go beyond the high level API:
ExtensionDictobject instead of the raw DICTIONARY object
See also the DXFEntity reference.
line_weightas synonym for
true_colorattribute (DXF R2004+, undocumented)
Layer.colorproperty to set/get ACI color values
Layer.rgbproperty to set/get true color values as (R, G, B) tuples
Layer.transparencyproperty to set/get layer transparency as float value between 0 and 1
Layer.descriptionproperty to set/get layer description
rename(): rename layer and all known (documented) references to this layer
See also the Layer reference.
Polyline vertices are now stored as
Vertex objects in a standard Python list called
See also the Polyline reference.
Block reference attributes (attached ATTRIB entites) are stored as
Attrib objects in a standard Python list called
See also the Insert reference.
Direct access to paths (
Hatch.paths), pattern (
Hatch.pattern) and gradient (
Hatch.gradient) objects, context
manager to edit this data is not needed anymore, but still available for backward compatibility
See also the Hatch reference.
MTextData methods into
MText, removed methods
set_text() are replaced by the property
MText.text and context manager
edit_data() is not needed
Dimension entity also removes the associated anonymous dimension block.
Same handling of the VIEWPORT entity for all DXF versions, but DXF R12 does not support all features, unsupported features are ignored at saving as DXF R12.
See also the Viewport reference.
ezdxf.options.template_dir, no more needed
ezdxf.options.log_unprocessed_tagsto log unprocessed (unknown) DXF tags, default is
Renaming layers by
Layer.rename(), renames the layer and all known (documented) references to this layer. Support for
true color, transparency and layer description.
Added support for the LEADER entity.
last properties, to get first or last entity or
None if query
result is empty.
Exclude DXF types from
'*' search, by appending type name with a preceding '!' e.g. query for all entities
except LINE =
See also ezdxf.render.forms documentation.
Importer add-on rewritten, API incompatible to previous ezdxf versions, but previous implementation was already broken.
See also Importer documentation.
Source code generator to create Python source code from DXF entities, to recreate this entities by ezdxf.
This tool creates only simple structures as a useful starting point for parametric DXF entity creation from existing DXF files. Not all DXF entities are supported!
See also dxf2code documentation.
Added support for named plot style tables ('.stb' files), see also Plot Style Files documentation.