Skip to main content

A comprehensive Python library for reading and writing DXF files

Project description

Translatio Delineationis Recens (formerly EzDXF) Library

A Python library to create and modify DXF drawings, compatible with Python 3.7 and above.

Overview

Translatio Delineationis Recens (formerly EzDXF) is an interface library for the DXF file format. The package is designed to facilitate the creation and manipulation of DXF documents, with compatibility across various DXF versions. It empowers users to seamlessly load and edit DXF files while preserving all content, except for comments.

Any unfamiliar DXF tags encountered in the document are gracefully ignored but retained for future modifications. This feature enables the processing of DXF documents containing data from third-party applications without any loss of valuable information.

Installation

pip install translatio-delineationis-recens

Or install from source:

git clone https://github.com/yourusername/translatio-delineationis-recens.git
cd translatio-delineationis-recens
pip install -e .

Basic Usage

import translatio_delineationis_recens as tdr

# Create a new DXF document
doc = tdr.new('R2010')  # or R12, R2000, R2004, R2007, R2013, R2018

# Add new entities to modelspace
msp = doc.modelspace()
msp.add_line((0, 0), (10, 10))
msp.add_circle((0, 0), radius=5)

# Save the document
doc.saveas('example.dxf')

# Open an existing DXF document
doc = tdr.readfile('example.dxf')

# Iterate through all entities in modelspace
msp = doc.modelspace()
for entity in msp:
    if entity.dxftype() == 'LINE':
        print(f"Line from {entity.dxf.start} to {entity.dxf.end}")
    elif entity.dxftype() == 'CIRCLE':
        print(f"Circle at {entity.dxf.center} with radius {entity.dxf.radius}")

Features

  • Create new DXF documents
  • Read and modify existing DXF files
  • Support for various DXF versions (R12, R2000, R2004, R2007, R2010, R2013, R2018)
  • Comprehensive entity support (lines, circles, arcs, text, dimensions, etc.)
  • Block management
  • Layer management
  • Viewport configuration
  • Extended entity data (XDATA)
  • Object attribute access via Python properties

Requirements

  • Python 3.7 or higher

License

MIT License

Documentation

For more detailed documentation, see the Docs directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

translatio_delineationis_recens-1.4.1b1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file translatio_delineationis_recens-1.4.1b1.tar.gz.

File metadata

File hashes

Hashes for translatio_delineationis_recens-1.4.1b1.tar.gz
Algorithm Hash digest
SHA256 631fc67c36438f5fca8b6313b57f08bc0183788aa5741aeb0d998d853111c11b
MD5 01114f173e416142a99daddfd5be8c1a
BLAKE2b-256 7459d101c0598f0c14c81e16d944f7ed0461862a87280391c6b32107c4f0b922

See more details on using hashes here.

File details

Details for the file translatio_delineationis_recens-1.4.1b1-py3-none-any.whl.

File metadata

File hashes

Hashes for translatio_delineationis_recens-1.4.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 bcc8089397a28aa67c9372550173f79b8150f8dae0e126f6d869f14524c99bf8
MD5 e7167afa44d36b31e34730131cd75f7d
BLAKE2b-256 130a3262323d4ddce1bdaf8d08c1f32a2fe730ef7c346bacac46f502e1e5eb8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page