Installing Dxfwrite in python

One can easily install dxfwrite with pip in python.

Just fire this :

pip install dxfwrite

Then test this simple example:

from dxfwrite import DXFEngine as dxf

drawing = dxf.drawing('test.dxf')
drawing.add_layer('LINES')
drawing.add(dxf.line((0, 0), (1, 0), color=7, layer='LINES'))
drawing.save()

It will create a file test.dxf in the current directory. Open this in a software like Qcad or something that’s capable of viewing dxf files.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s