Welcome! This is the documentation for ezdxf release 1.3.5, last updated Dec 15, 2024.
Quick-Info¶
ezdxf is a Python package to create new DXF documents and read/modify/write existing DXF documents
MIT-License
the intended audience are programmers
requires at least Python 3.9
OS independent
tested with CPython and pypy3
has type annotations and passes
mypy --ignore-missing-imports -p ezdxf
successfuladditional required packages for the core package without add-ons: typing_extensions, pyparsing, numpy, fontTools
read/write/new support for DXF versions: R12, R2000, R2004, R2007, R2010, R2013 and R2018
additional read-only support for DXF versions R13/R14 (upgraded to R2000)
additional read-only support for older DXF versions than R12 (upgraded to R12)
read/write support for ASCII DXF and Binary DXF
retains third-party DXF content
optional C-extensions for CPython are included in the binary wheels, available on PyPI for Windows, Linux and macOS
Included Extensions¶
Additional packages required for these add-ons are not automatically installed during the basic setup, for more information about the setup & dependencies visit the documentation.
drawing
add-on to visualise and convert DXF files to images which can be saved as PNG, PDF or SVG filesr12writer
add-on to write basic DXF entities direct and fast into a DXF R12 file or streamiterdxf
add-on to iterate over DXF entities from the modelspace of huge DXF files (> 5GB) which do not fit into memoryimporter
add-on to import entities, blocks and table entries from another DXF documentdxf2code
add-on to generate Python code for DXF structures loaded from DXF documents as starting point for parametric DXF entity creationacadctb
add-on to read/write Plot Style Files (CTB/STB)pycsg
add-on for Constructive Solid Geometry (CSG) modeling techniqueMTextExplode
add-on for exploding MTEXT entities into single-line TEXT entitiestext2path
add-on to convert text into outline pathsgeo
add-on to support the __geo_interface__meshex
add-on for exchanging meshes with other tools as STL, OFF or OBJ filesodafc
add-on, an interface to the ODA File Converter to read and write DWG fileshpgl2
add-on for converting HPGL/2 plot files to DXF, SVG and PDF
Website¶
Documentation¶
Documentation of development version at https://ezdxf.mozman.at/docs
Documentation of latest release at http://ezdxf.readthedocs.io/
Knowledge Graph¶
The Knowledge Graph contains additional information beyond the documentation and is
managed by logseq. The source data is included in the repository
in the folder ezdxf/notes
. There is also a HTML export
on the website which gets regular updates.
Release Notes¶
The release notes are included in the Knowledge Graph.
Changelog¶
The changelog is included in the Knowledge Graph.
Source Code & Feedback¶
Source Code: http://github.com/mozman/ezdxf.git
Issue Tracker: http://github.com/mozman/ezdxf/issues
Questions and Answers¶
Please post questions at the forum or stack overflow to make answers available to other users as well.
Contents¶
- Introduction
- Setup & Dependencies
- Usage for Beginners
- Basic Concepts
- Tasks
- External References (XREF)
- Add-ons
- Drawing / Export Add-on
- Design
- Common Limitations to all Backends
- MatplotlibBackend
- PyQtBackend
- Recorder
- Layout
- SVGBackend
- PyMuPdfBackend
- PlotterBackend
- DXFBackend
- GeoJSONBackend
- CustomJSONBackend
- Configuration
- BackgroundPolicy
- ColorPolicy
- HatchPolicy
- ImagePolicy
- LinePolicy
- LineweightPolicy
- ProxyGraphicPolicy
- TextPolicy
- Properties
- LayerProperties
- LayoutProperties
- RenderContext
- Frontend
- BackendInterface
- Backend
- Details
- Geo Interface
- Importer
- dxf2code
- iterdxf
- ODA File Converter Support
- R12 Export
- r12writer
- text2path
- MTextExplode
- HPGL/2 Converter Add-on
- PyCSG
- Plot Style Files (CTB/STB)
- Showcase Forms
- Bin-Packing Add-on
- MeshExchange
- OpenSCAD
- TablePainter
- MTextSurrogate for DXF R12
- ASTM-D6673-10 Exporter
- Drawing / Export Add-on
- Reference
- Launcher
- Tutorials
- Tutorial for Getting Data from DXF Files
- Tutorial for Creating DXF Drawings
- Tutorial for Common Graphical Attributes
- Tutorial for Layers
- Tutorial for Creating Linetype Pattern
- Tutorial for Creating Complex Linetype Pattern
- Tutorial for Simple DXF Entities
- Tutorial for Entity Selection
- Tutorial for Blocks
- Tutorial for LWPolyline
- Tutorial for Text
- Tutorial for MText and MTextEditor
- Tutorial for Spline
- Tutorial for Polyface
- Tutorial for Mesh
- Tutorial for Hatch
- Tutorial for Hatch Pattern Definition
- Tutorial for Image and ImageDef
- Tutorial for Underlay and UnderlayDefinition
- Tutorial for MultiLeader
- Tutorial for Viewports in Paperspace
- Tutorial for OCS/UCS Usage
- Tutorial for UCS Based Transformations
- Tutorial for Linear Dimensions
- Tutorial for Radius Dimensions
- Tutorial for Diameter Dimensions
- Tutorial for Angular Dimensions
- Tutorial for Arc Dimensions
- Tutorial for Ordinate Dimensions
- Tutorial for the Geo Add-on
- Storing Custom Data in DXF Files
- Tutorial for External References
- Tutorial for Image Export
- Howto
- General Document
- Load DXF Files with Structure Errors
- Set/Get Header Variables
- Set DXF Drawing Units
- Explore the DXF File Structure
- Calculate Extents for the Modelspace
- Set Initial View/Zoom for the Modelspace
- Hide the UCS Icon
- Show Lineweights in DXF Viewers
- Add ezdxf Resources to Existing DXF Document
- Set Logging Level of ezdxf
- DXF Viewer
- DXF Content
- Get/Set Entity Color
- Get/Set Entity RGB Color
- Get/Set True Color as RGB-Tuple
- Get/Set Block Reference Attributes
- Adding XDATA to Entities
- Get Overridden DIMSTYLE Values from DIMENSION
- Override DIMSTYLE Values for DIMENSION
- How to Change the HATCH Pattern Origin Point
- How to Get the Length of a Spline or Polyline
- How to Resolve DXF Properties
- How to Find XREF Definitions
- How to Find XREF References
- Fonts
- Drawing Add-on
- General Document
- FAQ
- Glossary
- Knowledge Graph