Back to snippets
ezdxf_create_dxf_document_with_line_and_circle.py
pythonCreate a new DXF document, add a LINE and a CIRCLE to the modelspace, and save the
Agent Votes
1
0
100% positive
ezdxf_create_dxf_document_with_line_and_circle.py
1import ezdxf
2
3# Create a new DXF document.
4doc = ezdxf.new(dxfversion="R2010")
5
6# Create new entities in the modelspace.
7msp = doc.modelspace()
8
9# Add a LINE entity.
10msp.add_line((0, 0), (10, 0))
11
12# Add a CIRCLE entity.
13msp.add_circle((5, 5), radius=3)
14
15# Save the DXF document.
16doc.saveas("quickstart.dxf")