Coder Social home page Coder Social logo

dxfwrite's Introduction

dxfwrite

Read The Docs

Abstract

A Python library to create DXF R12 drawings.

a simple example:

from dxfwrite import DXFEngine as dxf
drawing = dxf.drawing('test.dxf')
drawing.add(dxf.line((0, 0), (10, 0), color=7))
drawing.add_layer('TEXTLAYER', color=2)
drawing.add(dxf.text('Test', insert=(0, 0.2), layer='TEXTLAYER'))
drawing.save()

supported DXF R12 entities

  • ARC
  • ATTDEF
  • ATTRIB
  • BLOCK
  • CIRCLE
  • 3DFACE
  • INSERT
  • LINE
  • POINT
  • POLYLINE (special Polyface and Polymesh objects are available)
  • SHAPE (not tested)
  • SOLID
  • TRACE
  • TEXT
  • VERTEX (only for internal use, see Polyline, Polyface and Polymesh objects)
  • VIEWPORT

not supported DXF R12 entities

  • DIMENSION

emulated entities from DXF R13 and later

  • MTEXT (R13) ... emulated as composite entity MText
  • ELLIPSE (R13) ... approximated by Ellipse
  • SPLINE (R13) ... approximated by Spline
  • LWPOLYLINE (R13) ... use POLYLINE
  • TABLE (R2005) ... emulated as composite entity Table

composite entities

  • MText -- multi-line text
  • LinearDimension
  • AngularDimension
  • ArcDimension
  • RadialDimension
  • Table -- text and blockrefs containing table like a HTML-table
  • Ellipse -- approximated as POLYLINE
  • Spline -- cubic spline curve through breakpoints without additional control points, approximated as POLYLINE
  • Bezier -- cubic bezier curve through breakpoints with additional control points, approximated as POLYLINE
  • Clothoid -- Euler spiral, approximated as POLYLINE

read/write AutoCAD ctb-files

The module acadctb provides the ability to read and write AutoCAD ctb-files. With ctb-files you can assign a new color or lineweight to a dxf-color-index for plotting or printing, but this has to be supported by the used application.

a simple example:

from dxfwrite import acadctb
ctb = acadctb.load('test.ctb')
style1 = ctb.get_style(1) # dxf color index (1 .. 255)
style1.set_color(23, 177, 68) # set rgb values (0..255)
style1.set_lineweight(0.7)
ctb.save('new.ctb')

Installation

with pip:

pip install dxfwrite

or from source:

python setup.py install

Documentation

http://dxfwrite.readthedocs.io

The source code repository of dxfwrite can be found at GitHub.com:

https://github.com/mozman/dxfwrite.git

Feedback is greatly appreciated.

Contact

[email protected]

dxfwrite's People

Contributors

jeanmichelfischer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.