Ezdxf Documentation Release 0.16.6

Ezdxf Documentation Release 0.16.6

ezdxf Documentation Release 0.16.6 Manfred Moitzi Aug 28, 2021 Contents 1 Included Extensions 3 2 Website 5 3 Documentation 7 4 Source Code & Feedback 9 5 Questions and Answers 11 6 Contents 13 6.1 Introduction............................................... 13 6.2 Setup & Dependencies.......................................... 14 6.3 Usage for Beginners........................................... 16 6.4 Basic Concepts.............................................. 21 6.5 Tutorials................................................. 33 6.6 Howto.................................................. 137 6.7 FAQ.................................................... 144 6.8 Reference................................................. 145 6.9 Launcher................................................. 413 6.10 Rendering................................................ 420 6.11 Add-ons................................................. 438 6.12 DXF Internals.............................................. 486 6.13 Developer Guides............................................ 570 6.14 Glossary................................................. 584 6.15 Indices and tables............................................ 584 Python Module Index 585 Index 587 i ii ezdxf Documentation, Release 0.16.6 Welcome! This is the documentation for ezdxf release 0.16.6, last updated Aug 28, 2021. • ezdxf is a Python package to create new DXF files and read/modify/write existing DXF files • the intended audience are developers • requires at least Python 3.7 • OS independent • additional required packages: pyparsing • optional Cython implementation of some low level math classes • MIT-License • read/write/new support for DXF versions: R12, R2000, R2004, R2007, R2010, R2013 and R2018 • additional read support for DXF versions R13/R14 (upgraded to R2000) • additional read support for older DXF versions than R12 (upgraded to R12) • read/write support for ASCII DXF and Binary DXF • preserves third-party DXF content Contents 1 ezdxf Documentation, Release 0.16.6 2 Contents CHAPTER 1 Included Extensions • drawing add-on to visualise and convert DXF files to images which can be saved to various formats such as png, pdf and svg • geo add-on to support the __geo_interface__ • r12writer add-on to write basic DXF entities direct and fast into a DXF R12 file or stream • iterdxf add-on to iterate over entities of the modelspace of really big (> 5GB) DXF files which do not fit into memory • importer add-on to import entities, blocks and table entries from another DXF document • dxf2code add-on to generate Python code for DXF structures loaded from DXF documents as starting point for parametric DXF entity creation • acadctb add-on to read/write Plot Style Files (CTB/STB) • pycsg add-on for Constructive Solid Geometry (CSG) modeling technique 3 ezdxf Documentation, Release 0.16.6 4 Chapter 1. Included Extensions CHAPTER 2 Website https://ezdxf.mozman.at/ 5 ezdxf Documentation, Release 0.16.6 6 Chapter 2. Website CHAPTER 3 Documentation Documentation of development version at https://ezdxf.mozman.at/docs Documentation of latest release at http://ezdxf.readthedocs.io/ 7 ezdxf Documentation, Release 0.16.6 8 Chapter 3. Documentation CHAPTER 4 Source Code & Feedback Source Code: http://github.com/mozman/ezdxf.git Issue Tracker: http://github.com/mozman/ezdxf/issues Forum: https://github.com/mozman/ezdxf/discussions 9 ezdxf Documentation, Release 0.16.6 10 Chapter 4. Source Code & Feedback CHAPTER 5 Questions and Answers Please post questions at the forum or stack overflow to make answers available to other users as well. 11 ezdxf Documentation, Release 0.16.6 12 Chapter 5. Questions and Answers CHAPTER 6 Contents 6.1 Introduction 6.1.1 What is ezdxf ezdxf is a Python interface to the DXF (drawing interchange file) format developed by Autodesk, ezdxf allows devel- opers to read and modify existing DXF drawings or create new DXF drawings. The main objective in the development of ezdxf was to hide complex DXF details from the programmer but still support most capabilities of the DXF format. Nevertheless, a basic understanding of the DXF format is required, also to understand which tasks and goals are possible to accomplish by using the the DXF format. Not all DXF features are supported yet, but additional features will be added in the future gradually. ezdxf is also a replacement for my dxfwrite and my dxfgrabber packages but with different APIs, for more information see also: What is the Relationship between ezdxf, dxfwrite and dxfgrabber? 6.1.2 What ezdxf can’t do • ezdxf is not a DXF converter: ezdxf can not convert between different DXF versions, if you are looking for an appropriate application, try the free ODAFileConverter from the Open Design Alliance, which converts between different DXF version and also between the DXF and the DWG file format. • ezdxf is not a CAD file format converter: ezdxf can not convert DXF files to other CAD formats such as DWG • ezdxf is not a CAD kernel and does not provide high level functionality for construction work, it is just an interface to the DXF file format. If you are looking for a CAD kernel with Python scripting support, look at FreeCAD. 6.1.3 Supported Python Versions ezdxf requires at least Python 3.7 and will be tested with the latest stable CPython version and the latest stable release of pypy3 during development. 13 ezdxf Documentation, Release 0.16.6 ezdxf is written in pure Python with optional Cython implementations of some low level math classes and requires only pyparser and typing_extensions as additional library beside the Python Standard Library. pytest is required to run the unit and integration tests. Data to run the stress and audit test can not be provided, because I don’t have the rights for publishing this DXF files. 6.1.4 Supported Operating Systems ezdxf is OS independent and runs on all platforms which provide an appropriate Python interpreter (>=3.7). 6.1.5 Supported DXF Versions Version AutoCAD Release AC1009 AutoCAD R12 AC1012 AutoCAD R13 -> R2000 AC1014 AutoCAD R14 -> R2000 AC1015 AutoCAD R2000 AC1018 AutoCAD R2004 AC1021 AutoCAD R2007 AC1024 AutoCAD R2010 AC1027 AutoCAD R2013 AC1032 AutoCAD R2018 ezdxf also reads older DXF versions but saves it as DXF R12. 6.1.6 Embedded DXF Information of 3rd Party Applications The DXF format allows third-party applications to embed application-specific information. ezdxf manages DXF data in a structure-preserving form, but for the price of large memory requirement. Because of this, processing of DXF information of third-party applications is possible and will retained on rewriting. 6.1.7 License ezdxf is licensed under the very liberal MIT-License. 6.2 Setup & Dependencies The primary goal is to keep the dependencies for the core package as small as possible. The add-ons are not part of the core package and can therefore use as many packages as needed. The only requirement for these packages is an easy way to install them on Windows, Linux and macOS, preferably as pip3 install .... The pyparsing package is the only hard dependency and will be installed automatically by pip3! Ezdxf provides since v0.15 some C-extensions, which will be deployed automatically at each release to PyPI as binary wheels for Windows, ManyLinux 2010 and macOS. The supported Python versions start with the latest stable version of pypy3, which is currently Python 3.7 (2021) and ends with the latest stable release of CPython. The C-extensions are disabled for pypy3, because the JIT compiled code of pypy is much faster than the compiled C-extensions for pypy. 14 Chapter 6. Contents ezdxf Documentation, Release 0.16.6 6.2.1 Basic Installation The most common case is the installation by pip3 including the optional C-extensions from PyPI as binary wheels: pip3 install ezdxf 6.2.2 Installation with Extras To use all features of the drawing add-on, add the [draw] tag: pip3 install ezdxf[draw] Tag Additional Installed Packages [draw] Matplotlib, PyQt5 [test] geomdl, pytest [dev] setuptools, wheel, Cython + [test] [all] [draw] + [test] + [dev] 6.2.3 Disable C-Extensions It is possible to disable the C-Extensions by setting the environment variable EZDXF_DISABLE_C_EXT to 1 or true: set EZDXF_DISABLE_C_EXT=1 or on Linux: export EZDXF_DISABLE_C_EXT=1 This is has to be done before anything from ezdxf is imported! If you are working in an interactive environment, you have to restart the interpreter. 6.2.4 Installation from GitHub Install the latest development version by pip3 from GitHub: pip3 install git+https://github.com/mozman/ezdxf.git@master 6.2.5 Build and Install from Source Make a build directory and a virtual environment and sorry, I am working on Windows: mkdir build cd build py-m venv py39 py39\Scripts\activate.bat A working C++ compiler setup is required to compile the C-extensions from source code. Windows users need the build tools from Microsoft: https://visualstudio.microsoft.com/de/downloads/ 6.2. Setup & Dependencies 15 ezdxf Documentation, Release 0.16.6 Download and install the required Visual Studio Installer of the community edition and choose the option: Visual Studio Build Tools 20.. Install required packages to build and install ezdxf with C-extensions: pip3 install setuptools wheel cython Clone the GitHub repository: git clone https://github.com/mozman/ezdxf.git Build and install ezdxf from source code: cd ezdxf pip3 install. Install the test dependencies and run the tests: pip3 install pytest geomdl pytest tests integration_tests Install optional dependencies to use all features, like the drawing add-on: pip3 install matplotlib PyQt5 6.2.6 Build Documentation Assuming you are still in the build directory build\ezdxf of the previous section and matplotlib is installed. Install Sphinx: pip3 install Sphinx sphinx-rtd-theme Build the HTML documentation: cd docs make.bat html The output is located in build\ezdxf\docs\build\html. 6.3 Usage for Beginners This section shows the intended usage of the ezdxf package. This is just a brief overview for new ezdxf users, follow the provided links for more detailed information. First import the package: import ezdxf 6.3.1 Loading DXF Files ezdxf supports loading ASCII and binary DXF files from a file: 16 Chapter 6.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    627 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us