40. dxf

class dxf.DxfExporter(filename, terminator='n')

Export geometry in DXF format.

While we certainly do not want to promote proprietary software, some of our users occasionally needed to export some model in DXF format. This class provides a minimum of functionality.

Open a file for export in DXF format.

No check is done that the file has a ‘.dxf’ extension. The file will by default be written in UNIX line termination mode. An existing file will be overwritten without warning!

DxfExporter objects have the following methods:

write(s)

Write a string to the dxf file.

The string does not include the line terminator.

out(code, data)

Output a string data item to the dxf file.

code is the group code, data holds the data

close()
Finalize and close the DXF file
section(name)
Start a new section
endSection()
End the current section
entities()
Start the ENTITIES section
layer(layer)
Export the layer
line(x, layer=0)

Export a line.

x is a (2,3) shaped array

Functions defined in the module dxf

dxf.exportDXF(filename, F)

Export a Formex to a DXF file

Currently, only plex-2 Formices can be exported to DXF.

Documentation

Previous topic

39. turtle — Turtle graphics for pyFormex

Next topic

41. export — Classes and functions for exporting geometry in various formats.

This Page